delayed_job
delayed_job copied to clipboard
Using cached code
Unfortunately when running with Rails in production Delayed Job insists on using old, presumably cached, code.
Surprisingly, after searching the issue to death, there doesn't seem to be any clear info on how to deploy this gem in production.
Is Rails.cache.clear
the way to deploy? Seems odd that it's not mentioned in readme if it is.
@nomasprime what makes you think it is using old code? It sounds like maybe you're not restarting the workers after a deploy.
See the Restarting docs: https://github.com/collectiveidea/delayed_job#restarting-delayed_job
Hi @danielmorrison
I've restarted many times and still the same result, spent the whole day trying to debug. Only Rails.cache.clear
seems to fix it.
I have development and test environments deployed on Azure. With similar input they were both acting unexpectedly and different to local development. I tried everything I could think of and Rails.cache.clear
fixed it on test. Want to understand what's going on and why restart doesn't work like it should.
I'm starting to wonder if relating to Docker build process. Restarted container where I ran the clear cache command and still works though.
Just ran Rails.cache.clear
on development env and didn't fix it this time. No idea what's going on with this.
@nomasprime i am experiencing the same issue
There are usually 2 possible causes of this
- An orphaned worker process somewhere still running the old code
- A restart procedure that ends up carrying forward environment details especially all the hidden environment variables Bundler injects into running ruby processes.