Sha256: 074cad8eb9fc1a6132ee07d2ec2a25e8cb996d7982ac5ac3b963658ba258a7f0

Contents?: true

Size: 318 Bytes

Versions: 13

Compression:

Stored size: 318 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
    redis.pcall('del', unique_key)
    redis.pcall('HDEL', 'uniquejobs', job_id)
    return 1
  else
    return 0
  end
else
  return -1
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
sidekiq-unique-jobs-6.0.5 redis/release_lock.lua
sidekiq-unique-jobs-6.0.4 redis/release_lock.lua
sidekiq-unique-jobs-6.0.3 redis/release_lock.lua
sidekiq-unique-jobs-6.0.2 redis/release_lock.lua
sidekiq-unique-jobs-6.0.1 redis/release_lock.lua
sidekiq-unique-jobs-6.0.0 redis/release_lock.lua
sidekiq-unique-jobs-6.0.0.rc8 redis/release_lock.lua
sidekiq-unique-jobs-6.0.0.rc7 redis/release_lock.lua
sidekiq-unique-jobs-6.0.0.rc6 redis/release_lock.lua
sidekiq-unique-jobs-6.0.0.rc5 redis/release_lock.lua
sidekiq-unique-jobs-6.0.0.rc4 redis/release_lock.lua
sidekiq-unique-jobs-6.0.0.rc3 redis/release_lock.lua
sidekiq-unique-jobs-6.0.0.rc2 redis/release_lock.lua