-
Notifications
You must be signed in to change notification settings - Fork 178
Open
Description
const redlock = new Redlock([ioClient], {
retryCount: -1,
});
const LOCK_TTL = 1_000;
const lock = await redlock.acquire(["someKey"], LOCK_TTL)
await new Promise(f => setTimeout(f, 5_000));
await lock.release();
// It never reaches here if the lock has expired
doSomethingElse()
If the lock expires, the code is stuck on release()
function.
- Is this behavior expected? I suspect it retries
release()
forever based onretryCount
, but can I have differentretryCount
for acquiring and releasing? - How do I check if the lock has expired, so I can skip the
release()
call?
I am connecting to a single Redis node
Metadata
Metadata
Assignees
Labels
No labels