Skip to content

Commit b49d43d

Browse files
committed
Configure PM2 for single instance to prevent sync conflicts
- Change from cluster mode with max instances to single fork instance - Add ENABLE_BACKGROUND_SYNC=false to prevent accidental sync in web processes - Guarantee no competing processes ever exist
1 parent 8c0f9c8 commit b49d43d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pm2.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
{
44
"name": "ratesServer",
55
"script": "lib/index.js",
6-
"instances" : "max",
7-
"exec_mode" : "cluster",
6+
"instances": 1,
7+
"exec_mode": "fork",
8+
"env": {
9+
"ENABLE_BACKGROUND_SYNC": "false"
10+
},
811
"error_file": "/var/log/pm2/ratesServer.error.log",
912
"out_file": "/var/log/pm2/ratesServer.out.log"
1013
},

0 commit comments

Comments
 (0)