7

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...
JVK
  • 3,782
  • 8
  • 43
  • 67
  • 1
    there seems to be no job that the worker could be working on. Are you sure you queued your job correctly? How do you enqueue? have you set the rails queue to resque in application.rb? – Dominik Goltermann Jan 04 '14 at 12:13
  • @DominikGoltermann you can see redis shows that jobs are queued in my detail above. So how do you think it is not queued? – JVK Jan 05 '14 at 08:25
  • @DominikGoltermann what do you mean by "have you set the rails queue to resque in application.rb?" – JVK Jan 05 '14 at 08:53
  • Can you give us details of your environment (Heroku etc)? – Richard Peck Jan 05 '14 at 13:02
  • @JVK it shows 0 pending jobs, although the redis keys might indicate that there is an enqueued job that is set to run at a certain time (Sat, 04 Jan 2014 10:52:51 GMT) (not sure how resque inserts keys like). regarding the application.rb i was thing of Rails.queue. Don't know if you're using that though. – Dominik Goltermann Jan 05 '14 at 16:58
  • @RichPeck you can see it is on my mac xxx-macbook.local – JVK Jan 06 '14 at 04:45
  • @DominikGoltermann I am using these two: require 'resque' require 'resque_scheduler' , using later one, you can schedule the job for some future time by passing a param 'delay'. but i used delay=0, means immediate – JVK Jan 06 '14 at 04:46
  • @JVK Can you put the screenshot of your Resque GUI, here? Most probably there will be a mismatch in your queue names. – ksinkar Feb 04 '14 at 12:32

1 Answers1

-3

I was having the same problem, then:

  • Using terminal, go to your project dir
  • Type in terminal: QUEUE=* rake resque:work
Cleyton
  • 2,338
  • 6
  • 23
  • 39