From 20c0d9d4d73ed3016d638999accd18ca5c9a756b Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 8 Nov 2013 10:16:25 -0800 Subject: [PATCH] Made Lua code in JobQueueRedis more readable with unpack() Change-Id: I52fb765a153acc7f16baa804ab2342e9b5dd9fd6 --- includes/job/JobQueueRedis.php | 78 ++++++++++++++++++---------------- 1 file changed, 42 insertions(+), 36 deletions(-) diff --git a/includes/job/JobQueueRedis.php b/includes/job/JobQueueRedis.php index e8c475d074..5c3c5e9c62 100644 --- a/includes/job/JobQueueRedis.php +++ b/includes/job/JobQueueRedis.php @@ -251,23 +251,24 @@ class JobQueueRedis extends JobQueue { } static $script = << 0 then -- Insert into delayed queue (release time as score) - redis.call('zAdd',KEYS[4],rtimestamp,id) + redis.call('zAdd',kDelayed,rtimestamp,id) else -- Insert into unclaimed queue - redis.call('lPush',KEYS[1],id) + redis.call('lPush',kUnclaimed,id) end if sha1 ~= '' then - redis.call('hSet',KEYS[2],id,sha1) - redis.call('hSet',KEYS[3],sha1,id) + redis.call('hSet',kSha1ById,id,sha1) + redis.call('hSet',kIdBySha1,sha1,id) end - redis.call('hSet',KEYS[5],id,blob) + redis.call('hSet',kData,id,blob) pushed = pushed + 1 end end @@ -343,16 +344,17 @@ LUA; protected function popAndDeleteBlob( RedisConnRef $conn ) { static $script = <<luaEval( $script, array( @@ -416,11 +419,12 @@ LUA; try { static $script = <<luaEval( $script, array( @@ -636,12 +640,13 @@ LUA; try { static $script = <<