I have a background worker that is a queue worker for a Bull JS node queue.
The problem is that if it auto deploys, there is a period of time when there are two instances of the workers running (each job takes around 45 seconds or so).
What I’d like to do is on deploy to ensure that when the new instance of the background service is running that the old instance is killed. It’s okay if the old instance gets killed while processing a job (it’ll just retry on the new instance). I could suspend the web service each time and then redeploy, but I was wondering if there was a more elegant way of doing this.