Sha256: f581fc77da4588e5e7c6c51d278afaceb8e6fe3940fe6599a6ecfe6954c46e32

Contents?: true

Size: 423 Bytes

Versions: 2

Compression:

Stored size: 423 Bytes

Contents

class SlowUntilExecutingWorker
  include Sidekiq::Worker
  sidekiq_options unique: :until_executing,
                  queue: :default,
                  unique_args: (lambda do |args|
                    [args.first]
                  end)

  def perform(some_args)
    Sidekiq::Logging.with_context(self.class.name) do
      SidekiqUniqueJobs.logger.debug { "#{__method__}(#{some_args})" }
    end
    sleep 15
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sidekiq-unique-jobs-5.0.2 rails_example/app/workers/slow_until_executing_worker.rb
sidekiq-unique-jobs-5.0.1 rails_example/app/workers/slow_until_executing_worker.rb