From e4b45e9e7cff3d0c6ac3f7dfa1da9ca21bc3fa64 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Sun, 19 Jan 2025 13:23:51 -0300 Subject: [PATCH] Update auth.ts --- apps/api/src/controllers/auth.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/api/src/controllers/auth.ts b/apps/api/src/controllers/auth.ts index c9ff86b0..b5d6e2c5 100644 --- a/apps/api/src/controllers/auth.ts +++ b/apps/api/src/controllers/auth.ts @@ -94,7 +94,10 @@ export async function getACUC( let retries = 0; const maxRetries = 5; - let rpcName = mode === RateLimiterMode.Extract || mode === RateLimiterMode.ExtractStatus ? "auth_credit_usage_chunk_extract" : "auth_credit_usage_chunk_test_21_credit_pack_n_extract"; + let rpcName = + mode === RateLimiterMode.Extract || mode === RateLimiterMode.ExtractStatus + ? "auth_credit_usage_chunk_extract" + : "auth_credit_usage_chunk_test_21_credit_pack_n_extract"; while (retries < maxRetries) { ({ data, error } = await supabase_service.rpc( rpcName, @@ -203,7 +206,7 @@ export async function supaAuthenticateUser( }; } - chunk = await getACUC(normalizedApi,false, true, mode); + chunk = await getACUC(normalizedApi, false, true, mode); if (chunk === null) { return { @@ -258,6 +261,9 @@ export async function supaAuthenticateUser( subscriptionData.plan, ); break; + case RateLimiterMode.ExtractStatus: + rateLimiter = getRateLimiter(RateLimiterMode.ExtractStatus, token); + break; case RateLimiterMode.CrawlStatus: rateLimiter = getRateLimiter(RateLimiterMode.CrawlStatus, token); break;