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