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, logger, unlock, unlock_by_arguments, unlock_by_jid, 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



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

def unlock(scope)
  if scope.to_sym == :server
    return true
  else
    fail ArgumentError, "#{scope} middleware can't #{__method__} #{unique_key}"
  end
end