class SidekiqUniqueJobs::LockTTL

def calculate

Returns:
  • (Integer) - the number of seconds to live

Other tags:
    Note: - this method takes into consideration the time
def calculate
  ttl = item[LOCK_TTL]
  ttl ||= worker_options[LOCK_TTL]
  ttl ||= item[LOCK_EXPIRATION] # TODO: Deprecate at some point
  ttl ||= worker_options[LOCK_EXPIRATION] # TODO: Deprecate at some point
  ttl ||= SidekiqUniqueJobs.config.lock_ttl
  ttl && ttl.to_i + time_until_scheduled
end