Describe the bug
Accord the docs, we can declare after_unlock as an instance method. In our case though, after_unlock doesn't seem to get called unless it's declared as a class method. Is there something we missed?
Worker class
class ExampleWorker
include Sidekiq::Worker
sidekiq_options queue: :low,
lock: :until_executed,
log_duplicate_payload: true,
retry: 3,
dead: false
def perform(lead_id, crm_integration_id)
...
end
def after_unlock
# not called
Sidekiq.logger.info(message: "#{self.class.name} after_unlock", ...)
...
end
def self.after_unlock
# called
Sidekiq.logger.info(message: "#{self.class.name} after_unlock", ...)
...
end
end
Additional context
Ruby Version: ruby-2.5.8
The sidekiq gems we have in Gemfile.lock:
sidekiq (6.0.7)
connection_pool (>= 2.2.2)
rack (~> 2.0)
rack-protection (>= 2.0.0)
redis (>= 4.1.0)
sidekiq-status (1.1.4)
chronic_duration
sidekiq (>= 3.0)
sidekiq-unique-jobs (6.0.21)
concurrent-ruby (~> 1.0, >= 1.0.5)
sidekiq (>= 4.0, < 7.0)
thor (~> 0)
Describe the bug
Accord the docs, we can declare
after_unlockas an instance method. In our case though,after_unlockdoesn't seem to get called unless it's declared as a class method. Is there something we missed?Worker class
Additional context
Ruby Version:
ruby-2.5.8The sidekiq gems we have in Gemfile.lock: