Nick:
This commit is contained in:
parent
43c2e877e7
commit
5b3c75b06e
@ -70,7 +70,7 @@ async function authenticateUser(req, res, mode?: RateLimiterMode): Promise<{ suc
|
|||||||
return { success: false, error: "Rate limit exceeded. Too many requests, try again in 1 minute.", status: 429 };
|
return { success: false, error: "Rate limit exceeded. Too many requests, try again in 1 minute.", status: 429 };
|
||||||
}
|
}
|
||||||
|
|
||||||
if (token === "this_is_just_a_preview_token" && mode === "scrape") {
|
if (token === "this_is_just_a_preview_token" && (mode === RateLimiterMode.Scrape || mode === RateLimiterMode.Preview)) {
|
||||||
return { success: true, team_id: "preview" };
|
return { success: true, team_id: "preview" };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,11 +70,12 @@ export function crawlRateLimit(plan: string){
|
|||||||
|
|
||||||
|
|
||||||
export function getRateLimiter(mode: RateLimiterMode){
|
export function getRateLimiter(mode: RateLimiterMode){
|
||||||
if(mode === RateLimiterMode.Preview){
|
switch(mode) {
|
||||||
return previewRateLimiter;
|
case RateLimiterMode.Preview:
|
||||||
}else if(mode === RateLimiterMode.CrawlStatus){
|
return previewRateLimiter;
|
||||||
return crawlStatusRateLimiter;
|
case RateLimiterMode.CrawlStatus:
|
||||||
}else{
|
return crawlStatusRateLimiter;
|
||||||
return serverRateLimiter;
|
default:
|
||||||
|
return serverRateLimiter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user