sidekiq-unique-jobs icon indicating copy to clipboard operation
sidekiq-unique-jobs copied to clipboard

after_unlock callback is not executed when using until_and_while_executing

Open ishields opened this issue 3 years ago • 0 comments

Describe the bug It seems as though the after_unlock_callback is never called when using the until_and_while_executing callback. The callback works as expected when using :until_executed

Expected behavior I expect the callback to fire when the lock is released (after execution)

Current behavior Callback does not fire.

Worker class

class TestWorker < BaseSidekiqWorker
  sidekiq_options queue: :high, retry: 0
  sidekiq_options lock: :until_and_while_executing, on_conflict: :reject

  def perform
    puts 'Running'
    puts 'Done'
    return
  end

  def after_unlock(item = nil)
    # called
    puts "Performing again in 25 seconds"
    self.class.perform_in(25.seconds, true)
  end
end

Additional context sidekiq-unique-jobs (7.1.12)

ishields avatar Jan 16 '22 22:01 ishields