Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku: Prevent worker process from restarting?

I have a Heroku worker setup to do a long running job which iterates over long periods. However whenever I do an update & deploy of other files in the repo this worker restarts, which is annoying, any way to avoid this?

like image 396
cal Avatar asked Oct 17 '25 07:10

cal


1 Answers

No. This behaviour is part of Heroku's Automatic Dyno Restarting.

You can't work around this. Instead, you need to build all parts of your app to be able to function properly despite the fact that all dynos will restart at least once every 24 hours or so, whether or not you deploy updates in your repo.

Most significantly, you need to build support for Graceful Shutdown into all your processes (e.g. web process and worker processes).

like image 84
Yoni Rabinovitch Avatar answered Oct 19 '25 12:10

Yoni Rabinovitch



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!