removeDeduplicationKey-1.js 678 B

123456789101112131415161718192021222324252627
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.removeDeduplicationKey = void 0;
  4. const content = `--[[
  5. Remove deduplication key if it matches the job id.
  6. Input:
  7. KEYS[1] deduplication key
  8. ARGV[1] job id
  9. Output:
  10. 0 - false
  11. 1 - true
  12. ]]
  13. local rcall = redis.call
  14. local deduplicationKey = KEYS[1]
  15. local jobId = ARGV[1]
  16. local currentJobId = rcall('GET', deduplicationKey)
  17. if currentJobId and currentJobId == jobId then
  18. return rcall("DEL", deduplicationKey)
  19. end
  20. return 0
  21. `;
  22. exports.removeDeduplicationKey = {
  23. name: 'removeDeduplicationKey',
  24. content,
  25. keys: 1,
  26. };
  27. //# sourceMappingURL=removeDeduplicationKey-1.js.map