UNPKG

@microfleet/ioredis-lock

Version:

Node distributed locking using redis with ioredis adapter

17 lines (14 loc) 338 B
/** * Exports the required lua scripts to be loaded into redis. */ export const delifequal = ` if redis.call("GET", KEYS[1]) == ARGV[1] then return redis.call("DEL", KEYS[1]) end return 0` export const pexpireifequal = ` if redis.call("GET", KEYS[1]) == ARGV[1] then return redis.call("PEXPIRE", KEYS[1], ARGV[2]) end return 0 `