7

When I run

rake resque:scheduler RAILS_ENV=production

I get the following output:

2013-09-19 18:16:16 Reloading Schedule
2013-09-19 18:16:16 Loading Schedule
2013-09-19 18:16:16 Scheduling aa_job 
2013-09-19 18:16:16 Scheduling bb_job 
2013-09-19 18:16:16 Scheduling cc_aggregator 
2013-09-19 18:16:16 Schedules Loaded

However I can see that none of this jobs get actually enqueued.I know my worker is up and running because if I do something like

Resque.enqueue(aa_job)

It gets enqueue and executed as expected.

Other thing, if I do Resque.schedule in my Rails console, I get {} (empty)

Any Ideas?

Thanks.

content01
  • 3,115
  • 6
  • 41
  • 61

3 Answers3

8

did you have workers on the corresponding queue?

resque_scheduler is only responsible for enqueueing jobs , i.e: you need to run both:

rake resque:scheduler RAILS_ENV=production and QUEUE=* rake resque:work

Gecko-Gecko
  • 401
  • 7
  • 11
  • 1
    OP states that his worker *is* up and running because he can enqueue jobs and see them being executed. – Thiago Figueiro Dec 08 '15 at 23:31
  • how to run these both the commands in entrypoint.sh file? rake resque:scheduler RAILS_ENV=production and QUEUE=* rake resque:work – Akshay Aug 09 '22 at 19:41
0

I've had the same problem. It appeared that there was another scheduler process started, and when I started one more, it wrote that it scheduled job, but actually it didn't. So I just restarted all scheduler processes and now it works fine for me.

RaskolnikOFF
  • 196
  • 2
  • 9
  • how did you restarted all scheduler processes? – content01 Nov 27 '13 at 22:05
  • 1
    I run `ps aux|grep resque`, find there pids for each resque-scheduler process, and then killed each using `kill -9 pid` command. Then monit started new process for me, but you probably should do it manually in any convenient way. – RaskolnikOFF Dec 09 '13 at 15:44
  • In case anyone else is using foreman to run start the scheduler and the workers, you'll find that stopping foreman necessitates doing what RaskolnikOFF suggests – Javier Evans Jan 05 '15 at 18:07
0

I had the same issue, which was solved by loading environment in the scheduler rake task:

rake environment resque:scheduler RAILS_ENV=production
Jeriko
  • 6,547
  • 4
  • 28
  • 40