Lock retry

This commit is contained in:
x032205
2025-09-02 14:13:12 -04:00
parent 6db4c614af
commit 3ebd5305c2

View File

@@ -86,7 +86,11 @@ export const identityUaServiceFactory = ({
let lock: Awaited<ReturnType<typeof keyStore.acquireLock>>;
try {
lock = await keyStore.acquireLock([KeyStorePrefixes.IdentityLockoutLock(LOCKOUT_KEY)], 1000);
lock = await keyStore.acquireLock([KeyStorePrefixes.IdentityLockoutLock(LOCKOUT_KEY)], 500, {
retryCount: 3,
retryDelay: 300,
retryJitter: 100
});
} catch (e) {
logger.info(`login failed to acquire lock [lockoutKey=${LOCKOUT_KEY}]`);
throw new RateLimitError({ message: "Rate limit exceeded" });