From 52186b9fe78b23441d07dc63bbc26a315288d0f8 Mon Sep 17 00:00:00 2001 From: Aric Lasry Date: Fri, 10 Nov 2023 17:23:39 +0100 Subject: [PATCH] Fix API rate limits (#2492) --- front/lib/api/assistant/pubsub.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/front/lib/api/assistant/pubsub.ts b/front/lib/api/assistant/pubsub.ts index 54b392133a59..ffcf50e10c7c 100644 --- a/front/lib/api/assistant/pubsub.ts +++ b/front/lib/api/assistant/pubsub.ts @@ -52,12 +52,12 @@ export async function postUserMessageWithPubSub( let timeframeSeconds: number | undefined = undefined; let rateLimitKey: string | undefined = ""; if (auth.user()?.id) { - maxPerTimeframe = 3; - timeframeSeconds = 120; + maxPerTimeframe = 256; + timeframeSeconds = 60 * 60; rateLimitKey = `postUserMessageUser:${auth.user()?.id}`; } else { - maxPerTimeframe = 20; - timeframeSeconds = 120; + maxPerTimeframe = 512; + timeframeSeconds = 60 * 60; rateLimitKey = `postUserMessageWorkspace:${auth.workspace()?.id}`; }