Question

I've got some background jobs that run for a long time (hours).

If I deploy my app while those background jobs are running, will the dynos those jobs are attached to get restarted (thus killing the jobs)?

More specifically, those background jobs deal with downloading large files to /tmp...meaning if that dyno got restarted, it would interrupt the download.

Was it helpful?

Solution

Dyno's are restarted when you deploy, yes.

More importantly though, if you are downloading to /tmp then a deployment would create a new slug with an empty /tmp so anything downloaded would no longer exist.

OTHER TIPS

Dynos are restarted on deployment.

They are also cycled once a day by Heroku automatically. Dynos can be restarted whenever it stops responding, or stopped and moved to another network location, all automatically. And as John mentioned, it will be a new instance, so all your previous downloaded files will be deleted.

You can look at some cases here - https://devcenter.heroku.com/articles/dynos#the-dyno-manager

Best practice on Heroku would be, not to have any writable files on the Dynos.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top