Processing jobs in the background using Resque and Resque-scheduler

421 views Asked by At

I'm building an iOS app using Ruby on Rails as the back-end. I need help with an issue while trying to use Resque and Resque-scheduler to run a delayed job in the future (using a 'deliveries' queue).

Basically, my jobs work correctly when I run both Resque and Resque-scheduler in the foreground, but the jobs don't process in Resque when I run them in the background (using BACKGROUND=yes).

If you see the screenshot below, you can see Resque-scheduler processing 'Delayed Items', but Resque doesn't actually process it. I have VERBOSE=1 set for Resque, so that I can see the logs.

enter image description here

Any idea what I'm doing wrong? Could it be my configuration settings being incorrect? Here's my configuration:

enter image description here

Thanks so much! Feel free to ask for more information if necessary.

1

There are 1 answers

0
kalyco On

I ran into this issue when I was moving to production. At first I added a pre and post deploy to start resque after the regular system configurations were running, because it causes a hitch if scheduler runs in the background. That worked but I later just added nohup to the arguement and that worked for me:

VERBOSE=1 PIDFILE=./resque_scheduler.pid BACKGROUND=yes nohup rake environment resque:scheduler >> log/resque_scheduler.log 2>&1'"