setDeduplicationKey.lua 401 B

123456789101112
  1. --[[
  2. Function to set the deduplication key for a job.
  3. Uses TTL from deduplication opts if provided.
  4. ]]
  5. local function setDeduplicationKey(deduplicationKey, jobId, deduplicationOpts)
  6. local ttl = deduplicationOpts and deduplicationOpts['ttl']
  7. if ttl and ttl > 0 then
  8. rcall('SET', deduplicationKey, jobId, 'PX', ttl)
  9. else
  10. rcall('SET', deduplicationKey, jobId)
  11. end
  12. end