You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am running my nodejs app using pm2 in cluster mode. My requirement for pm2:
mark a thread so that the load balancer doesn't route new requests to that thread but keep it running to finish any pending processes
waits for x seconds
reloads that thread
moves to next thread in cluster and repeat.
The idea is to keep it running but not stop. Stopping will terminate any on going process in it.
By waiting for x seconds before reloading we allow it to finish any pending processes.
This approach also ensures we have to make no changes in the code.
Is it possible to create a node script which handles the requirements? It seems like a basic use case.