fix double fetching of players
Some checks failed
Deploy Backend / deploy (push) Has been cancelled

This commit is contained in:
Lee
2024-10-12 02:36:44 +01:00
parent 786bc69cf3
commit 6947c30c23
2 changed files with 9 additions and 4 deletions

View File

@ -37,7 +37,7 @@ app.use(
timezone: "Europe/London",
run: async () => {
const pages = 10;
const cooldown = 60_000 / 200; // 200 requests per minute
const cooldown = 60_000 / 250; // 250 requests per minute
let toTrack: PlayerDocument[] = await PlayerModel.find({});
const toRemoveIds: string[] = [];
@ -54,7 +54,7 @@ app.use(
continue;
}
for (const player of page.players) {
const foundPlayer = await PlayerService.getPlayer(player.id, true);
const foundPlayer = await PlayerService.getPlayer(player.id, true, player);
await PlayerService.trackScoreSaberPlayer(foundPlayer, player);
toRemoveIds.push(foundPlayer.id);
}