From 9e22c9a4289e9dbf7a9483e1b0eb0d13e3d6a3ee Mon Sep 17 00:00:00 2001 From: Nicolas Date: Mon, 4 Nov 2024 18:14:38 -0500 Subject: [PATCH] Nick: etier1a --- apps/api/src/controllers/auth.ts | 2 ++ apps/api/src/lib/job-priority.ts | 4 ++++ apps/api/src/services/rate-limiter.ts | 15 +++++++++++++++ apps/api/src/types.ts | 1 + 4 files changed, 22 insertions(+) diff --git a/apps/api/src/controllers/auth.ts b/apps/api/src/controllers/auth.ts index 20c4a60a..c9f693c5 100644 --- a/apps/api/src/controllers/auth.ts +++ b/apps/api/src/controllers/auth.ts @@ -360,6 +360,8 @@ function getPlanByPriceId(price_id: string): PlanType { return "growthdouble"; case process.env.STRIPE_PRICE_ID_ETIER2C: return "etier2c"; + case process.env.STRIPE_PRICE_ID_ETIER1A_MONTHLY: //ocqh + return "etier1a"; default: return "free"; } diff --git a/apps/api/src/lib/job-priority.ts b/apps/api/src/lib/job-priority.ts index 6108e131..9d046052 100644 --- a/apps/api/src/lib/job-priority.ts +++ b/apps/api/src/lib/job-priority.ts @@ -74,6 +74,10 @@ export async function getJobPriority({ bucketLimit = 1000; planModifier = 0.05; break; + case "etier1a": + bucketLimit = 1000; + planModifier = 0.05; + break; default: bucketLimit = 25; diff --git a/apps/api/src/services/rate-limiter.ts b/apps/api/src/services/rate-limiter.ts index 8aa5ab77..85c4f747 100644 --- a/apps/api/src/services/rate-limiter.ts +++ b/apps/api/src/services/rate-limiter.ts @@ -16,6 +16,7 @@ const RATE_LIMITS = { growth: 50, growthdouble: 50, etier2c: 300, + etier1a: 1000, }, scrape: { default: 20, @@ -30,6 +31,7 @@ const RATE_LIMITS = { growth: 1000, growthdouble: 1000, etier2c: 2500, + etier1a: 1000, }, search: { default: 20, @@ -44,6 +46,7 @@ const RATE_LIMITS = { growth: 500, growthdouble: 500, etier2c: 2500, + etier1a: 1000, }, map:{ default: 20, @@ -58,6 +61,7 @@ const RATE_LIMITS = { growth: 500, growthdouble: 500, etier2c: 2500, + etier1a: 1000, }, preview: { free: 5, @@ -123,6 +127,13 @@ export const scrapeStatusRateLimiter = new RateLimiterRedis({ duration: 60, // Duration in seconds }); +export const etier1aRateLimiter = new RateLimiterRedis({ + storeClient: redisRateLimitClient, + keyPrefix: "etier1a", + points: 10000, + duration: 60, // Duration in seconds +}); + const testSuiteTokens = [ "a01ccae", "6254cf9", @@ -176,6 +187,10 @@ export function getRateLimiter( if(teamId && teamId === process.env.DEV_B_TEAM_ID) { return devBRateLimiter; } + + if(teamId && teamId === process.env.ETIER1A_TEAM_ID) { + return etier1aRateLimiter; + } if(teamId && manual.includes(teamId)) { return manualRateLimiter; diff --git a/apps/api/src/types.ts b/apps/api/src/types.ts index 216786d9..eddaa017 100644 --- a/apps/api/src/types.ts +++ b/apps/api/src/types.ts @@ -158,6 +158,7 @@ export type PlanType = | "growth" | "growthdouble" | "etier2c" + | "etier1a" | "free" | "";