From 32bf6de3b1b1a79343eba1c2496522cd2959700a Mon Sep 17 00:00:00 2001 From: Sinclair Chen Date: Wed, 23 Oct 2024 11:24:32 -0700 Subject: [PATCH] fix recalculate script firebase auth error --- backend/shared/src/update-user-portfolio-histories-core.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/shared/src/update-user-portfolio-histories-core.ts b/backend/shared/src/update-user-portfolio-histories-core.ts index a0ffc9f1c7..4898e1bf20 100644 --- a/backend/shared/src/update-user-portfolio-histories-core.ts +++ b/backend/shared/src/update-user-portfolio-histories-core.ts @@ -31,8 +31,10 @@ const userToPortfolioMetrics: { timeCachedPeriodProfits: number } } = {} -const LIMIT = isProd() ? 400 : 10 + export async function updateUserPortfolioHistoriesCore(userIds?: string[]) { + const LIMIT = isProd() ? 400 : 10 + const now = Date.now() const yesterday = now - DAY_MS const weekAgo = now - DAY_MS * 7