Sha256: 9255c3843eb5aee4e15fc7e2f2f061737fa294176692858b73a3a56c80096fa8

Contents?: true

Size: 328 Bytes

Versions: 6

Compression:

Stored size: 328 Bytes

Contents

local queue = KEYS[1]
local flight = KEYS[2]
local expire_at = tonumber(ARGV[1])

local job = redis.call('lpop', queue)
if (not job) then return nil end
job = job:sub(1,-2)..',"expire_at":'..expire_at.."}"

local flight_key = flight..string.match(job, '"jid":"([^"]*)"')
redis.call('set', flight_key, job)
return { queue, job }

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
atomic-sidekiq-1.3.0 lib/atomic_sidekiq/atomic_operation/lua_scripts/retrieve.lua
atomic-sidekiq-1.2.0 lib/atomic_sidekiq/atomic_operation/lua_scripts/retrieve.lua
atomic-sidekiq-1.1.4 lib/atomic_sidekiq/atomic_operation/lua_scripts/retrieve.lua
atomic-sidekiq-1.1.3 lib/atomic_sidekiq/atomic_operation/lua_scripts/retrieve.lua
atomic-sidekiq-1.1.2 lib/atomic_sidekiq/atomic_operation/lua_scripts/retrieve.lua
atomic-sidekiq-1.1.0 lib/atomic_sidekiq/atomic_operation/lua_scripts/retrieve.lua