releaseLock-1.js 538 B

12345678910111213141516171819202122232425
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.releaseLock = void 0;
  4. const content = `--[[
  5. Release lock
  6. Input:
  7. KEYS[1] 'lock',
  8. ARGV[1] token
  9. ARGV[2] lock duration in milliseconds
  10. Output:
  11. "OK" if lock extented succesfully.
  12. ]]
  13. local rcall = redis.call
  14. if rcall("GET", KEYS[1]) == ARGV[1] then
  15. return rcall("DEL", KEYS[1])
  16. else
  17. return 0
  18. end
  19. `;
  20. exports.releaseLock = {
  21. name: 'releaseLock',
  22. content,
  23. keys: 1,
  24. };
  25. //# sourceMappingURL=releaseLock-1.js.map