Skip to content

Commit

Permalink
Edit updateStats route
Browse files Browse the repository at this point in the history
  • Loading branch information
kakajuro committed Sep 3, 2024
1 parent be8a7f0 commit 4e08f2a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/src/routes/updateStats.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,10 @@ router.post("/", validInstall, async (req: Request, res: Response) => {

for (const [key, value] of Object.entries(incomingStats)) {
if (!Number.isInteger(value)) {
throw new Error(`Value for ${key} is not an integer: ${value}`);
console.warn(`WARNING updating stats: Value for ${key} is not an integer: ${value}. Skipping this value...`);
} else {
await redisClient.hincrby("stats", key, value);
}
await redisClient.hincrby("stats", key, value);
}

let sumOfSectionsRemoved:number = 0;
Expand Down

0 comments on commit 4e08f2a

Please sign in to comment.