chore(locking-redis): default ttl to acquire lock (#13221)
* chore(locking-redis): default ttl to acquire lock * ttl only for the method execute
This commit is contained in:
committed by
GitHub
parent
cbfe646ce1
commit
83d2ce762c
5
.changeset/moody-timers-hang.md
Normal file
5
.changeset/moody-timers-hang.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"@medusajs/locking-redis": patch
|
||||
---
|
||||
|
||||
chore(locking-redis): default TTL to acquire lock
|
||||
@@ -115,12 +115,13 @@ export class RedisLockingProvider implements ILockingProvider {
|
||||
promises.push(this.getTimeout(timeoutSeconds, cancellationToken))
|
||||
}
|
||||
|
||||
const ONE_MINUTE = 60
|
||||
promises.push(
|
||||
this.acquire_(
|
||||
keys,
|
||||
{
|
||||
awaitQueue: true,
|
||||
expire: args?.timeout ? timeoutSeconds : 0,
|
||||
expire: args?.timeout ? timeoutSeconds : ONE_MINUTE,
|
||||
},
|
||||
cancellationToken
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user