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:
1 parent
cbfe646ce1
commit
83d2ce762c
2 files changed
+7
-1
No files matched your search
@@ -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))
|
promises.push(this.getTimeout(timeoutSeconds, cancellationToken))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ONE_MINUTE = 60
|
||||||
promises.push(
|
promises.push(
|
||||||
this.acquire_(
|
this.acquire_(
|
||||||
keys,
|
keys,
|
||||||
{
|
{
|
||||||
awaitQueue: true,
|
awaitQueue: true,
|
||||||
expire: args?.timeout ? timeoutSeconds : 0,
|
expire: args?.timeout ? timeoutSeconds : ONE_MINUTE,
|
||||||
},
|
},
|
||||||
cancellationToken
|
cancellationToken
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user