Skip to content

Commit

Permalink
Fix API rate limits (#2492)
Browse files Browse the repository at this point in the history
  • Loading branch information
lasryaric authored Nov 10, 2023
1 parent 9f14dc3 commit 52186b9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions front/lib/api/assistant/pubsub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
}

Expand Down

0 comments on commit 52186b9

Please sign in to comment.