From a0681d7b1cf32684af6839aa5af36a830e64cd64 Mon Sep 17 00:00:00 2001 From: Liam Date: Fri, 11 Oct 2024 18:48:04 +0100 Subject: [PATCH] add tracking cooldown --- projects/backend/src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/backend/src/index.ts b/projects/backend/src/index.ts index bb3e10c..e433212 100644 --- a/projects/backend/src/index.ts +++ b/projects/backend/src/index.ts @@ -50,6 +50,7 @@ app.use( const page = await scoresaberService.lookupPlayers(pageNumber); if (page === undefined) { console.log(`Failed to fetch players on page ${pageNumber}, skipping page...`); + await delay(cooldown); continue; } for (const player of page.players) { @@ -57,6 +58,7 @@ app.use( await PlayerService.trackScoreSaberPlayer(foundPlayer, player); toRemoveIds.push(foundPlayer.id); } + await delay(cooldown); } console.log(`Finished tracking player statistics for ${pages} pages, found ${toRemoveIds.length} players.`);