Class: SidekiqUniqueJobs::Lock::UntilTimeout

Inherits:
UntilExecuted show all
Defined in:
lib/sidekiq_unique_jobs/lock/until_timeout.rb

Instance Method Summary collapse

Methods inherited from UntilExecuted

#after_yield_yield, #initialize, #lock, #max_lock_time, #unique_key

Methods included from Unlockable

after_unlock, ensure_job_id_removed, logger, unlock, unlock_by_key

Constructor Details

This class inherits a constructor from SidekiqUniqueJobs::Lock::UntilExecuted

Instance Method Details

#execute(_callback) ⇒ Object



12
13
14
# File 'lib/sidekiq_unique_jobs/lock/until_timeout.rb', line 12

def execute(_callback)
  yield if block_given?
end

#unlock(scope) ⇒ Object

Raises:

  • (ArgumentError)


6
7
8
9
10
# File 'lib/sidekiq_unique_jobs/lock/until_timeout.rb', line 6

def unlock(scope)
  return true if scope.to_sym == :server

  raise ArgumentError, "#{scope} middleware can't #{__method__} #{unique_key}"
end