Skip to content

Commit

Permalink
Cap message limit (#2690)
Browse files Browse the repository at this point in the history
* Cap messages per user at 50 / 3 hours

* Display it on price table

* Update wording
  • Loading branch information
PopDaph authored Nov 28, 2023
1 parent 697dbec commit 34ca001
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions front/lib/api/assistant/pubsub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ export async function postUserMessageWithPubSub(
let timeframeSeconds: number | undefined = undefined;
let rateLimitKey: string | undefined = "";
if (auth.user()?.id) {
maxPerTimeframe = 256;
timeframeSeconds = 60 * 60;
maxPerTimeframe = 50;
timeframeSeconds = 60 * 60 * 3;
rateLimitKey = `postUserMessageUser:${auth.user()?.id}`;
} else {
maxPerTimeframe = 512;
Expand Down
4 changes: 4 additions & 0 deletions front/pages/w/[wId]/subscription/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
Spinner,
} from "@dust-tt/sparkle";
import { GetServerSideProps, InferGetServerSidePropsType } from "next";
import Link from "next/link";
import { useRouter } from "next/router";
import React, { useContext, useEffect } from "react";

Expand Down Expand Up @@ -256,6 +257,9 @@ export default function Subscription({
</div>
</div>
))}
<Link href="/terms" target="_blank" className="text-sm">
Terms of use apply to all plans.
</Link>
</Page.Vertical>
) : (
<Page.Vertical>
Expand Down

0 comments on commit 34ca001

Please sign in to comment.