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:
Carlos R. L. Rodrigues
2025-08-15 11:44:24 -03:00
committed by GitHub
parent cbfe646ce1
commit 83d2ce762c
2 changed files with 7 additions and 1 deletions

View File

@@ -0,0 +1,5 @@
---
"@medusajs/locking-redis": patch
---
chore(locking-redis): default TTL to acquire lock

View File

@@ -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
)