Skip to content

Commit

Permalink
allow hydrating unsaved rooms
Browse files Browse the repository at this point in the history
  • Loading branch information
howardchung committed Feb 7, 2025
1 parent c767d2d commit ae1274c
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions server/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,13 @@ io.engine.use(async (req: any, res: Response, next: () => void) => {
const data = persistedRoom?.data
? JSON.stringify(persistedRoom.data)
: undefined;
if (data) {
const room = new Room(io, key, data);
rooms.set(key, room);
console.log(
'loading room %s into memory on shard %s',
roomId,
config.SHARD,
);
}
const room = new Room(io, key, data);
rooms.set(key, room);
console.log(
'loading room %s into memory on shard %s',
roomId,
config.SHARD,
);
}
next();
});
Expand Down

0 comments on commit ae1274c

Please sign in to comment.