From 030ecab6eebd4ad73945e5faf315f1cc547a3277 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Fri, 13 Sep 2024 18:09:59 -0400 Subject: [PATCH] Update rate-limiter.ts --- apps/api/src/services/rate-limiter.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/apps/api/src/services/rate-limiter.ts b/apps/api/src/services/rate-limiter.ts index 1a40671a..51a0ecfa 100644 --- a/apps/api/src/services/rate-limiter.ts +++ b/apps/api/src/services/rate-limiter.ts @@ -104,6 +104,13 @@ export const devBRateLimiter = new RateLimiterRedis({ duration: 60, // Duration in seconds }); +export const manualRateLimiter = new RateLimiterRedis({ + storeClient: redisRateLimitClient, + keyPrefix: "manual", + points: 2000, + duration: 60, // Duration in seconds +}); + export const scrapeStatusRateLimiter = new RateLimiterRedis({ storeClient: redisRateLimitClient, @@ -114,6 +121,8 @@ export const scrapeStatusRateLimiter = new RateLimiterRedis({ const testSuiteTokens = ["a01ccae", "6254cf9", "0f96e673", "23befa1b", "69141c4"]; +const manual = ["69be9e74-7624-4990-b20d-08e0acc70cf6"]; + export function getRateLimiter( mode: RateLimiterMode, token: string, @@ -129,6 +138,10 @@ export function getRateLimiter( return devBRateLimiter; } + if(teamId && manual.includes(teamId)) { + return manualRateLimiter; + } + const rateLimitConfig = RATE_LIMITS[mode]; // {default : 5} if (!rateLimitConfig) return serverRateLimiter;