14 lines
373 B
Lua
14 lines
373 B
Lua
--[[
|
|
Function to move job from prioritized state to active.
|
|
]]
|
|
|
|
local function moveJobFromPrioritizedToActive(priorityKey, activeKey, priorityCounterKey)
|
|
local prioritizedJob = rcall("ZPOPMIN", priorityKey)
|
|
if #prioritizedJob > 0 then
|
|
rcall("LPUSH", activeKey, prioritizedJob[1])
|
|
return prioritizedJob[1]
|
|
else
|
|
rcall("DEL", priorityCounterKey)
|
|
end
|
|
end
|