Sha256: 845c1a434b51cdd58d024ab8b3b364bcaf55308e081ea4d99147d77bf5ff214d

Contents?: true

Size: 610 Bytes

Versions: 40

Compression:

Stored size: 610 Bytes

Contents

-- AUTOGENERATED FILE DO NOT EDIT DIRECTLY
local zset_key = KEYS[1]
local processed_key = KEYS[2]
local worker_queue_key = KEYS[3]
local owners_key = KEYS[4]

local current_time = ARGV[1]
local timeout = ARGV[2]

local lost_tests = redis.call('zrangebyscore', zset_key, 0, current_time - timeout)
for _, test in ipairs(lost_tests) do
  if redis.call('sismember', processed_key, test) == 0 then
    redis.call('zadd', zset_key, current_time, test)
    redis.call('lpush', worker_queue_key, test)
    redis.call('hset', owners_key, test, worker_queue_key) -- Take ownership
    return test
  end
end

return nil

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
ci-queue-0.58.0 lib/ci/queue/redis/reserve_lost.lua
ci-queue-0.57.0 lib/ci/queue/redis/reserve_lost.lua
ci-queue-0.56.0 lib/ci/queue/redis/reserve_lost.lua
ci-queue-0.55.0 lib/ci/queue/redis/reserve_lost.lua
ci-queue-0.52.0 lib/ci/queue/redis/reserve_lost.lua
ci-queue-0.51.0 lib/ci/queue/redis/reserve_lost.lua
ci-queue-0.50.0 lib/ci/queue/redis/reserve_lost.lua
ci-queue-0.49.0 lib/ci/queue/redis/reserve_lost.lua
ci-queue-0.48.0 lib/ci/queue/redis/reserve_lost.lua
ci-queue-0.47.0 lib/ci/queue/redis/reserve_lost.lua
ci-queue-0.46.0 lib/ci/queue/redis/reserve_lost.lua
ci-queue-0.45.0 lib/ci/queue/redis/reserve_lost.lua
ci-queue-0.44.0 lib/ci/queue/redis/reserve_lost.lua
ci-queue-0.43.0 lib/ci/queue/redis/reserve_lost.lua
ci-queue-0.42.0 lib/ci/queue/redis/reserve_lost.lua
ci-queue-0.41.0 lib/ci/queue/redis/reserve_lost.lua
ci-queue-0.40.0 lib/ci/queue/redis/reserve_lost.lua
ci-queue-0.39.0 lib/ci/queue/redis/reserve_lost.lua
ci-queue-0.38.0 lib/ci/queue/redis/reserve_lost.lua
ci-queue-0.37.0 lib/ci/queue/redis/reserve_lost.lua