0

Nick: fixed rate limit on status

This commit is contained in:
Nicolas 2024-06-14 12:13:02 -07:00
parent 0ec26576d6
commit e37aa3db57
2 changed files with 5 additions and 3 deletions

View File

@ -41,8 +41,8 @@ const RATE_LIMITS = {
default: 5, default: 5,
}, },
account: { account: {
free: 20, free: 100,
default: 20, default: 100,
}, },
crawlStatus: { crawlStatus: {
free: 150, free: 150,
@ -82,11 +82,13 @@ export function getRateLimiter(
token: string, token: string,
plan?: string plan?: string
) { ) {
if (token.includes("a01ccae") || token.includes("6254cf9")) { if (token.includes("a01ccae") || token.includes("6254cf9")) {
return testSuiteRateLimiter; return testSuiteRateLimiter;
} }
const rateLimitConfig = RATE_LIMITS[mode]; // {default : 5} const rateLimitConfig = RATE_LIMITS[mode]; // {default : 5}
if (!rateLimitConfig) return serverRateLimiter; if (!rateLimitConfig) return serverRateLimiter;
const planKey = plan ? plan.replace("-", "") : "default"; // "default" const planKey = plan ? plan.replace("-", "") : "default"; // "default"

View File

@ -45,7 +45,7 @@ export interface FirecrawlJob {
export enum RateLimiterMode { export enum RateLimiterMode {
Crawl = "crawl", Crawl = "crawl",
CrawlStatus = "crawl-status", CrawlStatus = "crawlStatus",
Scrape = "scrape", Scrape = "scrape",
Preview = "preview", Preview = "preview",
Search = "search", Search = "search",