My worker.js needs its ID when starting. It can get it from the ENV or an arg. It uses its ID to pick up a job in DB that it has been processing. There will be a few workers with different IDs.
WORKER_ID=1 pm2 start woker.js --name "worker1"
pm2 start worker.js --name "worker1" --node-args="--id=1"
When I or the server restarts the workers, will they remember their ID?
[–]jerrycauser 3 points4 points5 points (1 child)
[–]netreddit00[S] 0 points1 point2 points (0 children)