From e37aa3db57b0916a75bb4b3b2e36828577879605 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Fri, 14 Jun 2024 12:13:02 -0700 Subject: [PATCH] Nick: fixed rate limit on status --- apps/api/src/services/rate-limiter.ts | 6 ++++-- apps/api/src/types.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/api/src/services/rate-limiter.ts b/apps/api/src/services/rate-limiter.ts index 705d1c7..68079e5 100644 --- a/apps/api/src/services/rate-limiter.ts +++ b/apps/api/src/services/rate-limiter.ts @@ -41,8 +41,8 @@ const RATE_LIMITS = { default: 5, }, account: { - free: 20, - default: 20, + free: 100, + default: 100, }, crawlStatus: { free: 150, @@ -82,11 +82,13 @@ export function getRateLimiter( token: string, plan?: string ) { + if (token.includes("a01ccae") || token.includes("6254cf9")) { return testSuiteRateLimiter; } const rateLimitConfig = RATE_LIMITS[mode]; // {default : 5} + if (!rateLimitConfig) return serverRateLimiter; const planKey = plan ? plan.replace("-", "") : "default"; // "default" diff --git a/apps/api/src/types.ts b/apps/api/src/types.ts index 20fb527..0d5be01 100644 --- a/apps/api/src/types.ts +++ b/apps/api/src/types.ts @@ -45,7 +45,7 @@ export interface FirecrawlJob { export enum RateLimiterMode { Crawl = "crawl", - CrawlStatus = "crawl-status", + CrawlStatus = "crawlStatus", Scrape = "scrape", Preview = "preview", Search = "search",