fix player statistic tracking
Some checks failed
Deploy Backend / deploy (push) Has been cancelled

This commit is contained in:
Lee
2024-10-10 01:40:21 +01:00
parent 0f1c101acc
commit fc287be481
3 changed files with 10 additions and 11 deletions

View File

@ -32,13 +32,13 @@ export const app = new Elysia();
app.use(
cron({
name: "player-statistics-tracker-cron",
pattern: "0 1 * * *", // Every day at 00:01 (midnight)
pattern: "*/1 * * * *", // Every day at 00:01 (midnight)
timezone: "Europe/London",
run: async () => {
console.log("Tracking player statistics...");
const players: PlayerDocument[] = await PlayerModel.find({});
for (const player of players) {
await PlayerService.trackScoreSaberPlayer(getMidnightAlignedDate(new Date()), player);
await PlayerService.trackScoreSaberPlayer(player);
}
console.log("Finished tracking player statistics.");
},