Projektstart

This commit is contained in:
2026-01-22 15:49:12 +01:00
parent 7212eb6f7a
commit 57e5f652f8
10637 changed files with 2598792 additions and 64 deletions

View File

@@ -0,0 +1,26 @@
--[[
Function to handle the case when job is duplicated.
]]
-- Includes
--- @include "updateExistingJobsParent"
local function handleDuplicatedJob(jobKey, jobId, currentParentKey, currentParent,
parentData, parentDependenciesKey, completedKey, eventsKey, maxEvents, timestamp)
local existedParentKey = rcall("HGET", jobKey, "parentKey")
if not existedParentKey or existedParentKey == currentParentKey then
updateExistingJobsParent(currentParentKey, currentParent, parentData,
parentDependenciesKey, completedKey, jobKey,
jobId, timestamp)
else
if currentParentKey ~= nil and currentParentKey ~= existedParentKey
and (rcall("EXISTS", existedParentKey) == 1) then
return -7
end
end
rcall("XADD", eventsKey, "MAXLEN", "~", maxEvents, "*", "event",
"duplicated", "jobId", jobId)
return jobId .. "" -- convert to string
end