Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(lobbies): fix warnings #595

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading