fix(auth/redlock): retry cached ACUC lock for 20 seconds

This commit is contained in:
Gergő Móricz 2024-09-25 22:25:13 +02:00
parent 0f89f5e7cb
commit 81245e68fa
1 changed files with 4 additions and 1 deletions

View File

@ -43,7 +43,10 @@ export async function setCachedACUC(api_key: string, acuc: AuthCreditUsageChunk
const lockTTL = 10000; // 10 seconds
try {
const lock = await redlock.acquire([redLockKey], lockTTL);
const lock = await redlock.acquire([redLockKey], lockTTL, {
retryCount: 200,
retryDelay: 100,
});
try {
if (typeof acuc === "function") {