Skip to content

Commit

Permalink
fix(flow): remove failed children references on auto removal (#2432)
Browse files Browse the repository at this point in the history
  • Loading branch information
roggervalf authored Feb 17, 2024
1 parent 83e8a61 commit 8a85207
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/commands/moveToFinished-14.lua
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,19 @@ local rcall = redis.call
--- Includes
--- @include "includes/collectMetrics"
--- @include "includes/getNextDelayedTimestamp"
--- @include "includes/getRateLimitTTL"
--- @include "includes/getTargetQueueList"
--- @include "includes/moveJobFromPriorityToActive"
--- @include "includes/prepareJobForProcessing"
--- @include "includes/moveParentFromWaitingChildrenToFailed"
--- @include "includes/moveParentToWaitIfNeeded"
--- @include "includes/prepareJobForProcessing"
--- @include "includes/promoteDelayedJobs"
--- @include "includes/removeJobKeys"
--- @include "includes/removeJobsByMaxAge"
--- @include "includes/removeJobsByMaxCount"
--- @include "includes/removeParentDependencyKey"
--- @include "includes/trimEvents"
--- @include "includes/updateParentDepsIfNeeded"
--- @include "includes/getRateLimitTTL"

local jobIdKey = KEYS[12]
if rcall("EXISTS", jobIdKey) == 1 then -- // Make sure job exists
Expand Down Expand Up @@ -183,8 +184,11 @@ if rcall("EXISTS", jobIdKey) == 1 then -- // Make sure job exists
removeJobsByMaxCount(maxCount, targetSet, prefix)
end
else
rcall("DEL", jobIdKey, jobIdKey .. ':logs', jobIdKey .. ':processed')
removeJobKeys(jobIdKey)
if parentKey ~= "" then
-- TODO: when a child is removed when finished, result or failure in parent
-- must not be deleted, those value references should be deleted when the parent
-- is deleted
removeParentDependencyKey(jobIdKey, false, parentKey)
end
end
Expand Down

0 comments on commit 8a85207

Please sign in to comment.