mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-08-18 00:28:14 +00:00
have master remove game id if it fails to fetch game from worker
This commit is contained in:
@@ -163,7 +163,7 @@ app.get(
|
|||||||
async function fetchLobbies(): Promise<number> {
|
async function fetchLobbies(): Promise<number> {
|
||||||
const fetchPromises = [];
|
const fetchPromises = [];
|
||||||
|
|
||||||
for (const gameID of publicLobbyIDs) {
|
for (const gameID of new Set(publicLobbyIDs)) {
|
||||||
const controller = new AbortController();
|
const controller = new AbortController();
|
||||||
setTimeout(() => controller.abort(), 5000); // 5 second timeout
|
setTimeout(() => controller.abort(), 5000); // 5 second timeout
|
||||||
const port = config.workerPort(gameID);
|
const port = config.workerPort(gameID);
|
||||||
@@ -178,6 +178,7 @@ async function fetchLobbies(): Promise<number> {
|
|||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
log.error(`Error fetching game ${gameID}:`, error);
|
log.error(`Error fetching game ${gameID}:`, error);
|
||||||
// Return null or a placeholder if fetch fails
|
// Return null or a placeholder if fetch fails
|
||||||
|
publicLobbyIDs.delete(gameID);
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+1
-1
Submodule src/server/gatekeeper updated: 8324db9408...1f14b7a526
Reference in New Issue
Block a user