Rails4: Why resque worker is not picking up jobs

4.2k views Asked by At

I am using resque and resque_scheduler in my rails 4 app. My app is putting some jobs for resque, but they are not being worked upon by workers. reque-web shows no failure.

I have started resque worker by running

QUEUE=kqueue rake environment resque:work

my rails console

2.0.0p353 :006 > Resque.info

 => {:pending=>0, :processed=>0, :queues=>0, :workers=>1, :working=>0, :failed=>0, :servers=>["redis://localhost:6379/0"], :environment=>"development"} 

2.0.0p353 :007 > Resque.redis

 => #<Redis::Namespace:0x007fbb0fbf3e58 @namespace=:resque, @redis=#<Redis client v3.0.6 for redis://localhost:6379/0>, @warning=false> 

2.0.0p353 :008 > Resque.workers

 => [#<Worker xxx-macbook.local:16869:kqueue>] 

On redis,

redis 127.0.0.1:6379> keys *
1) "resque:workers"
2) "resque:delayed_queue_schedule"
3) "resque:worker:xxx-macbook.local:16869:kqueue:started"
4) "resque:timestamps:{\"class\":\"InvokeScheduler\",\"args\":[{\"target\":\"/sendmail\",\"http_method\":\"post\",\"type\":\"signup_verification\",\"user_id\":31}],\"queue\":\"kqueue\"}"
5) "resque:delayed:1388832771"

resque-web says:

0 of 1 Workers Working

Failed Jobs
Showing 0 to 0 of 0 jobs


Worker xxx-macbook.local:16869:kqueue

Host    Pid   Started Queues  Processed Failed  Processing
xxx-macbook.local 16869 15 minutes ago  KQUEUE  0 0 Waiting for a job...
1

There are 1 answers

0
Cleyton On

I was having the same problem, then:

  • Using terminal, go to your project dir
  • Type in terminal: QUEUE=* rake resque:work