Search code examples
mysqlruby-on-railsdelayed-job

rails re-enable stuck jobs in delayed_job


I've been implementing delayed_job gem(mysql version) for some time now, and situation Trouble is some tasks seem to be stuck and they fail to execute.
example:

id, priority, attempts, run_at, created_at, updated_at
'8', '0', '0', '2015-01-15 15:32:45', '2015-01-15 15:32:42', '2015-01-15 15:32:42'
//Time according to my timezone

I use mysql workbench to run this simple script

UPDATE delayed_jobs
SET
run_at = NOW() + interval 1 minute,
created_at = NOW(),
updated_at = NOW();

I start delayed job on the server via ssh

$ RAILS_ENV=pre_prod bin/delayed_job -i=43 run
delayed_job.=43: process with pid 6407 started.

Nothing happens, jobs are still populating mysql table....
How can i relaunch these tasks ?
Can you help me ?


Solution

  • Funny enough the problem was in different timezones on DB server and server that application is ran on ...