class Sqeduler::TriggerLock

Super simple facade to match RufusScheduler's expectations of how a trigger_lock behaves.

Constants

SCHEDULER_LOCK_KEY

Public Class Methods

new() click to toggle source
Calls superclass method Sqeduler::RedisLock::new
# File lib/sqeduler/trigger_lock.rb, line 8
def initialize
  super(SCHEDULER_LOCK_KEY, :expiration => 60, :timeout => 0)
end

Public Instance Methods

lock() click to toggle source
Calls superclass method Sqeduler::RedisLock#lock
# File lib/sqeduler/trigger_lock.rb, line 12
def lock
  # Locking should:
  # - not block
  # - return true if already acquired
  # - refresh the lock if already acquired
  refresh || super
rescue
  false
end