Sha256: 21fac0954a0b7950cdebadb07bca2d3351c9c08e7da68fa40f70f012cb00748a

Contents?: true

Size: 516 Bytes

Versions: 6

Compression:

Stored size: 516 Bytes

Contents

# frozen_string_literal: true

# :nocov:

# This class will lock until the job is successfully executed
#
# It will wait for 0 seconds to acquire a lock and it will expire the unique key after 2 seconds
#
class UntilExecuted2Job
  include Sidekiq::Worker
  sidekiq_options queue: :working,
                  retry: 1,
                  backtrace: 10,
                  unique: :until_executed,
                  lock_timeout: 0

  def perform(one, two)
    [one, two]
  end

  def after_unlock
    # NO OP
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
sidekiq-unique-jobs-6.0.0.rc6 examples/until_executed_2_job.rb
sidekiq-unique-jobs-6.0.0.rc5 examples/until_executed_2_job.rb
sidekiq-unique-jobs-6.0.0.rc4 examples/until_executed_2_job.rb
sidekiq-unique-jobs-6.0.0.rc3 examples/until_executed_2_job.rb
sidekiq-unique-jobs-6.0.0.rc2 examples/until_executed_2_job.rb
sidekiq-unique-jobs-6.0.0.rc1 examples/until_executed_2_job.rb