removeListJobs.lua 514 B

1234567891011121314151617181920212223
  1. --[[
  2. Functions to remove jobs.
  3. ]]
  4. -- Includes
  5. --- @include "filterOutJobsToIgnore"
  6. --- @include "removeJobs"
  7. local function getListItems(keyName, max)
  8. return rcall('LRANGE', keyName, 0, max - 1)
  9. end
  10. local function removeListJobs(keyName, hard, baseKey, max, jobsToIgnore)
  11. local jobs = getListItems(keyName, max)
  12. if jobsToIgnore then
  13. jobs = filterOutJobsToIgnore(jobs, jobsToIgnore)
  14. end
  15. local count = removeJobs(jobs, hard, baseKey, max)
  16. rcall("LTRIM", keyName, #jobs, -1)
  17. return count
  18. end