From 1cb502cdc4bc2b6d2ad211a02b8dd385e2602f9d Mon Sep 17 00:00:00 2001 From: Manuel Astudillo Date: Tue, 26 Sep 2023 10:20:18 +0200 Subject: [PATCH] refactor: join statements into the same if statement --- src/commands/moveToActive-10.lua | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/commands/moveToActive-10.lua b/src/commands/moveToActive-10.lua index db2a82806a..1c93db0185 100644 --- a/src/commands/moveToActive-10.lua +++ b/src/commands/moveToActive-10.lua @@ -59,14 +59,13 @@ local expireTime = getRateLimitTTL(maxJobs, rateLimiterKey) local jobId = nil if ARGV[3] ~= "" then jobId = ARGV[3] -end -if jobId then -- clean stalled key rcall("SREM", KEYS[5], jobId) end if not jobId or (jobId and string.sub(jobId, 1, 2) == "0:") then + -- If jobId is special ID 0:delay, then there is no job to process if jobId then rcall("LREM", activeKey, 1, jobId) end -- Check if we are rate limited first. @@ -86,7 +85,6 @@ if not jobId or (jobId and string.sub(jobId, 1, 2) == "0:") then end end --- If jobId is special ID 0:delay, then there is no job to process if jobId then return prepareJobForProcessing(KEYS, ARGV[1], target, jobId, ARGV[2], maxJobs, expireTime, opts)