Sha256: e47a5113b00da4ac79226d010482f744f0d7ca3af864b87e27276b46a3dabbbc

Contents?: true

Size: 483 Bytes

Versions: 1

Compression:

Stored size: 483 Bytes

Contents

local grabbed_key   = KEYS[1]
local unique_digest = KEYS[2]

local job_id = ARGV[1]

local function current_time()
  local time = redis.call('time')
  local s = time[1]
  local ms = time[2]
  local number = tonumber((s .. '.' .. ms))

  return number
end

local old_token  = redis.call('GET', unique_digest)
if old_token then
  if old_token == job_id or old_token == '2' then
    redis.call('DEL', unique_digest)
    redis.call('HSET', grabbed_key, job_id, current_time())
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sidekiq-unique-jobs-6.0.11 redis/convert_legacy_lock.lua