Sha256: 4a4e45838030d5d6a755c9866f3df8770457e37a6afac250ec81d84804b8e52c
Contents?: true
Size: 1.02 KB
Versions: 42
Compression:
Stored size: 1.02 KB
Contents
-- AUTOGENERATED FILE DO NOT EDIT DIRECTLY local processed_key = KEYS[1] local requeues_count_key = KEYS[2] local queue_key = KEYS[3] local zset_key = KEYS[4] local max_requeues = tonumber(ARGV[1]) local global_max_requeues = tonumber(ARGV[2]) local test = ARGV[3] local offset = ARGV[4] if redis.call('sismember', processed_key, test) == 1 then return false end local global_requeues = tonumber(redis.call('hget', requeues_count_key, '___total___')) if global_requeues and global_requeues >= tonumber(global_max_requeues) then return false end local requeues = tonumber(redis.call('hget', requeues_count_key, test)) if requeues and requeues >= max_requeues then return false end redis.call('hincrby', requeues_count_key, '___total___', 1) redis.call('hincrby', requeues_count_key, test, 1) local pivot = redis.call('lrange', queue_key, -1 - offset, 0 - offset)[1] if pivot then redis.call('linsert', queue_key, 'BEFORE', pivot, test) else redis.call('lpush', queue_key, test) end redis.call('zrem', zset_key, test) return true
Version data entries
42 entries across 42 versions & 1 rubygems