class SidekiqUniqueJobs::OnConflict::Reschedule

@author Mikael Henriksson <mikael@zoolutions.se>
Strategy to reschedule job on conflict

def call

This will mess up sidekiq stats because a new job is created
Create a new job from the current one.
def call
  if sidekiq_worker_class?
    log_info("Rescheduling #{item[LOCK_DIGEST]}")
    worker_class&.perform_in(5, *item[ARGS])
  else
    log_warn("Skip rescheduling of #{item[LOCK_DIGEST]} because #{worker_class} is not a Sidekiq::Worker")
  end
end

def initialize(item, redis_pool = nil)

Parameters:
  • item (Hash) -- sidekiq job hash
def initialize(item, redis_pool = nil)
  super(item, redis_pool)
  @worker_class = item[CLASS]
end