Skip to content

Commit

Permalink
chore: replace cid in favor of chkey
Browse files Browse the repository at this point in the history
  • Loading branch information
roggervalf committed Dec 4, 2024
1 parent 53ea54c commit 7bf0d96
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ local function moveParentFromWaitingChildrenToFailed( parentQueueKey, parentKey,
rcall("XADD", parentQueueKey .. ":events", "*", "event", "failed", "jobId", parentId, "failedReason",
failedReason, "prev", "waiting-children")

local jobAttributes = rcall("HMGET", parentKey, "parent", "deid", "opts", "cid")
local jobAttributes = rcall("HMGET", parentKey, "parent", "deid", "opts", "chkey")

removeDeduplicationKeyIfNeeded(parentQueuePrefix, jobAttributes[2])
removeChainKeyIfNeeded(jobAttributes[4], parentKey)
Expand Down
2 changes: 1 addition & 1 deletion src/commands/includes/removeJob.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ local function removeJob(jobId, hard, baseKey, shouldRemoveDeduplicationKey)
if shouldRemoveDeduplicationKey then
removeDeduplicationKey(baseKey, jobKey)
end
removeChainKeyIfNeeded(rcall("HGET", jobKey, "cid"), jobKey)
removeChainKeyIfNeeded(rcall("HGET", jobKey, "chkey"), jobKey)
removeJobKeys(jobKey)
end
2 changes: 1 addition & 1 deletion src/commands/moveStalledJobsToWait-9.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ if (#stalling > 0) then
local stalledCount =
rcall("HINCRBY", jobKey, "stalledCounter", 1)
if (stalledCount > maxStalledJobCount) then
local jobAttributes = rcall("HMGET", jobKey, "opts", "parent", "deid", "cid")
local jobAttributes = rcall("HMGET", jobKey, "opts", "parent", "deid", "chkey")
local rawOpts = jobAttributes[1]
local rawParentData = jobAttributes[2]
local opts = cjson.decode(rawOpts)
Expand Down
2 changes: 1 addition & 1 deletion src/commands/removeJob-2.lua
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ local function removeJob(prefix, jobId, parentKey, removeChildren)
local prev = removeJobFromAnyState(prefix, jobId)

removeDeduplicationKey(prefix, jobKey)
removeChainKeyIfNeeded(rcall("HGET", jobKey, "cid"), jobKey)
removeChainKeyIfNeeded(rcall("HGET", jobKey, "chkey"), jobKey)
if removeJobKeys(jobKey) > 0 then
local maxEvents = getOrSetMaxEvents(KEYS[2])
rcall("XADD", prefix .. "events", "MAXLEN", "~", maxEvents, "*", "event", "removed", "jobId", jobId, "prev",
Expand Down

0 comments on commit 7bf0d96

Please sign in to comment.