moveJobToWait.lua 534 B

123456789101112131415
  1. --[[
  2. Function to move job to wait to be picked up by a waiting worker.
  3. ]]
  4. -- Includes
  5. --- @include "addJobInTargetList"
  6. --- @include "getTargetQueueList"
  7. local function moveJobToWait(metaKey, activeKey, waitKey, pausedKey, markerKey, eventStreamKey,
  8. jobId, pushCmd)
  9. local target, isPausedOrMaxed = getTargetQueueList(metaKey, activeKey, waitKey, pausedKey)
  10. addJobInTargetList(target, markerKey, pushCmd, isPausedOrMaxed, jobId)
  11. rcall("XADD", eventStreamKey, "*", "event", "waiting", "jobId", jobId, 'prev', 'active')
  12. end