Sha256: 8a460a9d4f2f40c7a080f87c7e7d6f31a57ff1f2f89fc961924c9fa6391b3a39

Contents?: true

Size: 338 Bytes

Versions: 3

Compression:

Stored size: 338 Bytes

Contents

local unique_key = KEYS[1]
local job_id     = ARGV[1]
local stored_jid = redis.pcall('get', unique_key)

if stored_jid then
  if stored_jid == job_id or stored_jid == '2' then
    if redis.pcall('del', unique_key) then
      redis.pcall('hdel', 'uniquejobs', job_id)
      return 1
    end
  else
    return 0
  end
else
  return -1
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
sidekiq-unique-jobs-4.0.16 redis/release_lock.lua
sidekiq-unique-jobs-4.0.15 redis/release_lock.lua
sidekiq-unique-jobs-4.0.13 redis/release_lock.lua