updateRepeatableJobMillis-1.js 970 B

123456789101112131415161718192021222324252627282930313233
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.updateRepeatableJobMillis = void 0;
  4. const content = `--[[
  5. Adds a repeatable job
  6. Input:
  7. KEYS[1] 'repeat' key
  8. ARGV[1] next milliseconds
  9. ARGV[2] custom key
  10. ARGV[3] legacy custom key TODO: remove this logic in next breaking change
  11. Output:
  12. repeatableKey - OK
  13. ]]
  14. local rcall = redis.call
  15. local repeatKey = KEYS[1]
  16. local nextMillis = ARGV[1]
  17. local customKey = ARGV[2]
  18. local legacyCustomKey = ARGV[3]
  19. if rcall("ZSCORE", repeatKey, customKey) then
  20. rcall("ZADD", repeatKey, nextMillis, customKey)
  21. return customKey
  22. elseif rcall("ZSCORE", repeatKey, legacyCustomKey) ~= false then
  23. rcall("ZADD", repeatKey, nextMillis, legacyCustomKey)
  24. return legacyCustomKey
  25. end
  26. return ''
  27. `;
  28. exports.updateRepeatableJobMillis = {
  29. name: 'updateRepeatableJobMillis',
  30. content,
  31. keys: 1,
  32. };
  33. //# sourceMappingURL=updateRepeatableJobMillis-1.js.map