Rails 4 アプリケーションに次のワーカーがあります。
class CallbackWorker
include Sidekiq::Worker
def perform(user_id)
user = User.find(user_id)
Rails.logger.info "[CallbackWorker] Initiating callback check for #{user.full_name}"
callback = user.callbacks.next.first
Rails.logger.info "[CallbackWorker] Next callback: #{callback.inspect}"
return unless callback
Rails.logger.info "[CallbackWorker] Calling user"
callback.execute
end
end
これは次のように呼び出されます。
def available!
if unavailable?
events.create! state: "available"
hours.create! action: "start"
end
CallbackWorker.perform_async(self.id)
end
しかし、Sidekiq プロセスで次のエラーが発生します。
2013-10-31T00:48:09Z 21627 TID-ouq3ot5mw WARN: {"retry"=>true, "queue"=>"default", "class"=>"CallbackWorker", "args"=>[1], "jid"=>"f5ff02372751c820aa7c8ed5", "enqueued_at"=>1383180489.304018}
2013-10-31T00:48:09Z 21627 TID-ouq3ot5mw WARN: undefined method `jid=' for #<CallbackWorker:0x007f898d3a3748>
2013-10-31T00:48:09Z 21627 TID-ouq3ot5mw WARN: /Users/fcoury/.rvm/gems/ruby-2.0.0-p247/gems/sidekiq-2.13.1/lib/sidekiq/processor.rb:44:in `block in process'
/Users/fcoury/.rvm/gems/ruby-2.0.0-p247/gems/sidekiq-2.13.1/lib/sidekiq/processor.rb:83:in `do_defer'
/Users/fcoury/.rvm/gems/ruby-2.0.0-p247/gems/sidekiq-2.13.1/lib/sidekiq/processor.rb:37:in `process'
/Users/fcoury/.rvm/gems/ruby-2.0.0-p247/gems/celluloid-0.15.0/lib/celluloid/calls.rb:25:in `public_send'
/Users/fcoury/.rvm/gems/ruby-2.0.0-p247/gems/celluloid-0.15.0/lib/celluloid/calls.rb:25:in `dispatch'
/Users/fcoury/.rvm/gems/ruby-2.0.0-p247/gems/celluloid-0.15.0/lib/celluloid/calls.rb:122:in `dispatch'
なぜ私のワーカーに jid を設定しようとしているのですか?