From a99da61039a7f21fa77a603daff2b3b8c56d30aa Mon Sep 17 00:00:00 2001 From: Ajay Date: Thu, 30 Jun 2022 17:56:06 -0400 Subject: [PATCH] Fetch user count right away --- src/routes/getTotalStats.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes/getTotalStats.ts b/src/routes/getTotalStats.ts index 6c6a01d..df310ab 100644 --- a/src/routes/getTotalStats.ts +++ b/src/routes/getTotalStats.ts @@ -10,9 +10,10 @@ let firefoxUsersCache = 0; // By the privacy friendly user counter let apiUsersCache = 0; - let lastUserCountCheck = 0; +updateExtensionUsers(); + export async function getTotalStats(req: Request, res: Response): Promise { const userCountQuery = `(SELECT COUNT(*) FROM (SELECT DISTINCT "userID" from "sponsorTimes") t) "userCount",`;