removeDeduplicationKeyIfNeededOnRemoval.lua 578 B

123456789101112131415161718
  1. --[[
  2. Function to remove deduplication key if needed
  3. when a job is being removed.
  4. ]]
  5. local function removeDeduplicationKeyIfNeededOnRemoval(prefixKey,
  6. jobId, deduplicationId)
  7. if deduplicationId then
  8. local deduplicationKey = prefixKey .. "de:" .. deduplicationId
  9. local currentJobId = rcall('GET', deduplicationKey)
  10. if currentJobId and currentJobId == jobId then
  11. rcall("DEL", deduplicationKey)
  12. -- Also clean up any pending dedup-next data for this dedup ID
  13. rcall("DEL", prefixKey .. "dn:" .. deduplicationId)
  14. return 1
  15. end
  16. end
  17. end