Skip to content

Commit

Permalink
chore(lobbies): fix warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanFlurry committed Sep 30, 2024
1 parent 60c69de commit 82a3a63
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions modules/lobbies/actors/lobby_manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ export class Actor extends ActorBase<undefined, State.StateVersioned> {
break;
case "ready":
return newLobby!;
case "aborted":
case "aborted": {
const destroyMeta = this.lobbyDestroyMeta[lobbyId];
if (destroyMeta?.cause) {
throw destroyMeta.cause;
Expand All @@ -326,7 +326,7 @@ export class Actor extends ActorBase<undefined, State.StateVersioned> {
meta: { reason: destroyMeta?.reason },
});
}
break;
}
default:
throw new UnreachableError(status);
}
Expand All @@ -349,7 +349,7 @@ export class Actor extends ActorBase<undefined, State.StateVersioned> {
unsubscribe();
resolve(newLobby!);
break;
case "aborted":
case "aborted": {
unsubscribe();

const destroyMeta = this.lobbyDestroyMeta[lobbyId];
Expand All @@ -363,6 +363,7 @@ export class Actor extends ActorBase<undefined, State.StateVersioned> {
);
}
break;
}
default:
throw new UnreachableError(status);
}
Expand Down Expand Up @@ -1164,7 +1165,7 @@ export class Actor extends ActorBase<undefined, State.StateVersioned> {
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];
Expand Down

0 comments on commit 82a3a63

Please sign in to comment.