From 82a3a63cf3da433c6dd4dc5ab00469b9a7d83cca Mon Sep 17 00:00:00 2001 From: Nathan Flurry Date: Sun, 29 Sep 2024 21:52:52 -0700 Subject: [PATCH] chore(lobbies): fix warnings --- modules/lobbies/actors/lobby_manager.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/lobbies/actors/lobby_manager.ts b/modules/lobbies/actors/lobby_manager.ts index 9b21a911..0831ee51 100644 --- a/modules/lobbies/actors/lobby_manager.ts +++ b/modules/lobbies/actors/lobby_manager.ts @@ -317,7 +317,7 @@ export class Actor extends ActorBase { break; case "ready": return newLobby!; - case "aborted": + case "aborted": { const destroyMeta = this.lobbyDestroyMeta[lobbyId]; if (destroyMeta?.cause) { throw destroyMeta.cause; @@ -326,7 +326,7 @@ export class Actor extends ActorBase { meta: { reason: destroyMeta?.reason }, }); } - break; + } default: throw new UnreachableError(status); } @@ -349,7 +349,7 @@ export class Actor extends ActorBase { unsubscribe(); resolve(newLobby!); break; - case "aborted": + case "aborted": { unsubscribe(); const destroyMeta = this.lobbyDestroyMeta[lobbyId]; @@ -363,6 +363,7 @@ export class Actor extends ActorBase { ); } break; + } default: throw new UnreachableError(status); } @@ -1164,7 +1165,7 @@ export class Actor extends ActorBase { public gc(ctx: ActorContext) { // GC destroy meta let expiredLobbyDestroyMeta = 0; - for (let [lobbyId, meta] of Object.entries(this.lobbyDestroyMeta)) { + for (const [lobbyId, meta] of Object.entries(this.lobbyDestroyMeta)) { if (Date.now() - meta.destroyedAt > 180_000) { expiredLobbyDestroyMeta++; delete this.lobbyDestroyMeta[lobbyId];