Sha256: 683f17d69b2758fe28079b37d5a4d6e9fed6b1fb5a77359736b1cf794006a56f
Contents?: true
Size: 383 Bytes
Versions: 15
Compression:
Stored size: 383 Bytes
Contents
local unique_key = KEYS[1] local job_id = ARGV[1] local expires = ARGV[2] local stored_jid = redis.pcall('get', unique_key) if stored_jid then if stored_jid == job_id then return 1 else return 0 end end if redis.pcall('set', unique_key, job_id, 'nx', 'ex', expires) then redis.pcall('hsetnx', 'uniquejobs', job_id, unique_key) return 1 else return 0 end
Version data entries
15 entries across 15 versions & 1 rubygems