Reputation: 171
I've got Resque set up in my Rails 3.2 app and have an after hook which successfully calls
Resque.enqueue(SomeJob, self.class.name, id)
I can see the job getting fired off, but no methods in my SomeJob class are getting executed. I've got a logger set up confirming the SomeJob gets executed but the log statement inside my self.perform block never gets called.
def self.perform
log.debug("working")
end
So far I've tried methods named self.work, work, self.perform, perform and nothing seems to get called. The Resque documentation seems to be geared towards a pending 2.0.0 release but I can't quite get this to work even with 1.24.1 or 1.22.
What is the magic method that gets called in Resque? Is there any way to explicitly call it in Resque.enqueue?
Upvotes: 0
Views: 300
Reputation: 524
At first glance it looks like you're passing in two arguments (self.class.name
and id
), but the self.perform method isn't able to accept them, so it could be silently failing with an invalid argument error.
My suggestion would be to change the self.perform method to the following:
def self.perform(class_name, id)
log.debug("working: class_name=#{class_name} id=#{id}")
end
Upvotes: 0