Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sidekiq: NoMethodError: undefined method `perform'

Here is what I am trying to do:

2.1.2 :001 > UpdateStyleRanks.perform_async

Here is the error:

NoMethodError: undefined method `perform' for #<UpdateStyleRanks:0x00000002f5e388>

Here is my worker:

# app/workers/update_style_ranks.rb
class UpdateStyleRanks
  include Sidekiq::Worker

  def perform
  end
end
like image 304
Abram Avatar asked Jul 20 '14 21:07

Abram


1 Answers

There is no naming requirement for workers. You can do this:

class Foo
  include Sidekiq::Worker
  def perform; end
end

I suspect you just need to restart Rails/Spring/Zeus to pick up the new class.

like image 169
Mike Perham Avatar answered Sep 18 '22 22:09

Mike Perham