From bcf7a238c98b2951a70021eea59000dcdfb2fef2 Mon Sep 17 00:00:00 2001 From: evanpelle Date: Mon, 19 May 2025 14:33:43 -0700 Subject: [PATCH] have master remove game id if it fails to fetch game from worker --- src/server/Master.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/server/Master.ts b/src/server/Master.ts index b50aaf110..19bddcfad 100644 --- a/src/server/Master.ts +++ b/src/server/Master.ts @@ -196,7 +196,7 @@ app.post( async function fetchLobbies(): Promise { const fetchPromises: Promise[] = []; - for (const gameID of publicLobbyIDs) { + for (const gameID of new Set(publicLobbyIDs)) { const controller = new AbortController(); setTimeout(() => controller.abort(), 5000); // 5 second timeout const port = config.workerPort(gameID); @@ -211,6 +211,7 @@ async function fetchLobbies(): Promise { .catch((error) => { log.error(`Error fetching game ${gameID}:`, error); // Return null or a placeholder if fetch fails + publicLobbyIDs.delete(gameID); return null; });