From a49c6b136d11752d5e2374c8e3acef2e000ce014 Mon Sep 17 00:00:00 2001 From: William Stein Date: Tue, 10 Dec 2024 03:38:30 +0000 Subject: [PATCH] better get-payments throttling by frontend --- src/packages/frontend/purchases/payments.tsx | 2 +- src/packages/util/api/throttle.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/packages/frontend/purchases/payments.tsx b/src/packages/frontend/purchases/payments.tsx index ac1e6fa60c..7a0f29601d 100644 --- a/src/packages/frontend/purchases/payments.tsx +++ b/src/packages/frontend/purchases/payments.tsx @@ -71,7 +71,7 @@ export default function Payments({ reset, }: { init?: boolean; reset?: boolean } = {}) => { const now = Date.now(); - if (now - lastLoadRef.current < 500) { + if (now - lastLoadRef.current < 3000) { return; } lastLoadRef.current = now; diff --git a/src/packages/util/api/throttle.ts b/src/packages/util/api/throttle.ts index b296a4270c..961ce88ad6 100644 --- a/src/packages/util/api/throttle.ts +++ b/src/packages/util/api/throttle.ts @@ -27,7 +27,7 @@ const THROTTLE = { }, "purchases/stripe/get-payments": { second: 3, - minute: 15, + minute: 20, hour: 150, }, "purchases/stripe/get-customer-session": {