content01
content01

Reputation: 3225

Resque-scheduler loading schedules but not enqueuing them

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.

Upvotes: 7

Views: 4203

Answers (3)

Jeriko
Jeriko

Reputation: 6637

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

rake environment resque:scheduler RAILS_ENV=production

Upvotes: 0

Gecko-Gecko
Gecko-Gecko

Reputation: 401

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

Upvotes: 8

RaskolnikOFF
RaskolnikOFF

Reputation: 306

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.

Upvotes: 0

Related Questions