mirror of
https://github.com/mendableai/firecrawl.git
synced 2024-11-16 03:32:22 +08:00
Nick:
This commit is contained in:
parent
d591e0f51c
commit
5606fe5870
|
@ -222,7 +222,8 @@ export async function supaAuthenticateUser(
|
|||
rateLimiter = getRateLimiter(
|
||||
RateLimiterMode.Scrape,
|
||||
token,
|
||||
subscriptionData.plan
|
||||
subscriptionData.plan,
|
||||
teamId
|
||||
);
|
||||
break;
|
||||
case RateLimiterMode.Search:
|
||||
|
|
|
@ -84,16 +84,28 @@ export const testSuiteRateLimiter = new RateLimiterRedis({
|
|||
duration: 60, // Duration in seconds
|
||||
});
|
||||
|
||||
export const devBRateLimiter = new RateLimiterRedis({
|
||||
storeClient: redisRateLimitClient,
|
||||
keyPrefix: "dev-b",
|
||||
points: 1200,
|
||||
duration: 60, // Duration in seconds
|
||||
});
|
||||
|
||||
export function getRateLimiter(
|
||||
mode: RateLimiterMode,
|
||||
token: string,
|
||||
plan?: string
|
||||
plan?: string,
|
||||
teamId?: string
|
||||
) {
|
||||
|
||||
if (token.includes("a01ccae") || token.includes("6254cf9") || token.includes("0f96e673")) {
|
||||
return testSuiteRateLimiter;
|
||||
}
|
||||
|
||||
if(teamId === process.env.DEV_B_TEAM_ID) {
|
||||
return devBRateLimiter;
|
||||
}
|
||||
|
||||
const rateLimitConfig = RATE_LIMITS[mode]; // {default : 5}
|
||||
|
||||
if (!rateLimitConfig) return serverRateLimiter;
|
||||
|
|
Loading…
Reference in New Issue
Block a user