From 01503c1fbff76613ddb937372068ae5dc9997770 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Thu, 6 Jun 2024 09:29:25 -0700 Subject: [PATCH 1/2] Nick: --- apps/api/src/services/notification/email_notification.ts | 2 +- apps/api/src/services/rate-limiter.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/api/src/services/notification/email_notification.ts b/apps/api/src/services/notification/email_notification.ts index 7ae2f53..9343ddf 100644 --- a/apps/api/src/services/notification/email_notification.ts +++ b/apps/api/src/services/notification/email_notification.ts @@ -20,7 +20,7 @@ const emailTemplates: Record< }, [NotificationType.RATE_LIMIT_REACHED]: { subject: "Rate Limit Reached - Firecrawl", - html: "Hey there,

You've hit your Firecrawl rate limit! Take a breather and try again in a few moments. If you need more higher rate limits, consider upgrading your plan. Check out our pricing page for more info.

If you have any questions, feel free to reach out to us at hello@firecrawl.com


Thanks,
Firecrawl Team
Ps. this email is only sent once every 7 days if you reach the limit.", + html: "Hey there,

You've hit your Firecrawl rate limit! Take a breather and try again in a few moments. If you need higher rate limits, consider upgrading your plan. Check out our pricing page for more info.

If you have any questions, feel free to reach out to us at hello@firecrawl.com


Thanks,
Firecrawl Team

Ps. this email is only sent once every 7 days if you reach the limit.", }, }; diff --git a/apps/api/src/services/rate-limiter.ts b/apps/api/src/services/rate-limiter.ts index e2faecc..fc73df1 100644 --- a/apps/api/src/services/rate-limiter.ts +++ b/apps/api/src/services/rate-limiter.ts @@ -7,6 +7,7 @@ const RATE_LIMITS = { free: 2, starter: 3, standard: 5, + standardOld: 40, scale: 20, hobby: 3, standardNew: 10, @@ -15,6 +16,7 @@ const RATE_LIMITS = { scrape: { free: 5, starter: 20, + standard: 40, standardOld: 40, scale: 50, hobby: 10, @@ -25,6 +27,7 @@ const RATE_LIMITS = { free: 5, starter: 20, standard: 40, + standardOld: 40, scale: 50, hobby: 10, standardNew: 50, From 0310da67290b73cae4810ea030f943d39b9b5239 Mon Sep 17 00:00:00 2001 From: Nicolas Date: Thu, 6 Jun 2024 09:31:44 -0700 Subject: [PATCH 2/2] Update rate-limiter.ts --- apps/api/src/services/rate-limiter.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/api/src/services/rate-limiter.ts b/apps/api/src/services/rate-limiter.ts index fc73df1..51543a6 100644 --- a/apps/api/src/services/rate-limiter.ts +++ b/apps/api/src/services/rate-limiter.ts @@ -16,7 +16,7 @@ const RATE_LIMITS = { scrape: { free: 5, starter: 20, - standard: 40, + standard: 50, standardOld: 40, scale: 50, hobby: 10, @@ -68,5 +68,6 @@ export function getRateLimiter(mode: RateLimiterMode, token: string, plan?: stri const planKey = plan ? plan.replace("-", "") : "starter"; const points = rateLimitConfig[planKey] || rateLimitConfig.preview; + return createRateLimiter(`${mode}-${planKey}`, points); }