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; });