Sha256: 194d1dccc6cd33c685634addaa7d2a5ee107615c3d2338eddeb5ad833125d843

Contents?: true

Size: 471 Bytes

Versions: 4

Compression:

Stored size: 471 Bytes

Contents

-- Add all jobs to sorted set
local eta = redis.call("ZADD", KEYS[1], unpack(ARGV))

-- Set ETA key; this is merely the number of jobs that need to be processed
redis.call("SET", KEYS[3], eta)

-- Queue jobs that are ready to be processed (their score is 0) and
-- remove queued jobs from the sorted set
local work = redis.call("ZRANGEBYSCORE", KEYS[1], 0, 0)
if #work > 0 then
  redis.call("LPUSH", KEYS[2], unpack(work))
  redis.call("ZREM", KEYS[1], unpack(work))
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pallets-0.11.0 lib/pallets/backends/scripts/run_workflow.lua
pallets-0.10.0 lib/pallets/backends/scripts/run_workflow.lua
pallets-0.9.0 lib/pallets/backends/scripts/run_workflow.lua
pallets-0.8.0 lib/pallets/backends/scripts/run_workflow.lua