Search code examples
ruby-on-railssidekiq

Sidekiq - Enqueued Job is running from old code


I have about 30 sidekiq jobs scheduled in the future (let's days 1 in a day for the next 30 days).

I use capistrano for deployment. So I have 5 release directories at anytime. Let's say:

/var/www/release1/ (recent)
/var/www/release2/
/var/www/release3/
/var/www/release4/
/var/www/release5/

Let's say after few days, I make a new release. Now, the previously scheduled jobs are still running from the old code. Is this expected? How can we fix this to ensure that it uses the latest release directory when it starts running rather than when it is scheduled?


Solution

  • This could be because sidekiq process didn't restart after a successful deployment.

    Make sure your deployment process restarts sidekiq and make sure restart actually works, otherwise sidekiq processes are still holding on to old code.

    https://github.com/mperham/sidekiq/wiki/Deployment