Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥
TypeScript aiai-agentsai-crawlerai-scrapingai-searchcrawlerdata-extractionhtml-to-markdownllmmarkdownscraperscrapingweb-crawlerweb-dataweb-data-extractionweb-scraperweb-scrapingweb-searchwebscraping
fix(auth): move redlock settings
Gergő Móricz250c3bb5c6c0
diff --git a/apps/api/src/controllers/auth.ts b/apps/api/src/controllers/auth.tsindex 73cb3d2af..2298430e7 100644--- a/apps/api/src/controllers/auth.ts+++ b/apps/api/src/controllers/auth.ts@@ -43,10 +43,7 @@ export async function setCachedACUC(api_key: string, acuc: AuthCreditUsageChunkconst lockTTL = 10000; // 10 secondstry {- const lock = await redlock.acquire([redLockKey], lockTTL, {- retryCount: 200,- retryDelay: 100,- });+ const lock = await redlock.acquire([redLockKey], lockTTL);try {if (typeof acuc === "function") {diff --git a/apps/api/src/services/redlock.ts b/apps/api/src/services/redlock.tsindex 9cbfc1fc1..cb275736e 100644--- a/apps/api/src/services/redlock.ts+++ b/apps/api/src/services/redlock.ts@@ -10,12 +10,9 @@ export const redlock = new Redlock(// http://redis.io/topics/distlockdriftFactor: 0.01, // multiplied by lock ttl to determine drift time- // The max number of times Redlock will attempt to lock a resource- // before erroring.- retryCount: 5,-- // the time in ms between attempts- retryDelay: 100, // time in ms+ retryCount: 200,++ retryDelay: 100,// the max time in ms randomly added to retries// to improve performance under high contention