Skip to content

Commit

Permalink
chore: debug broadcastMessage on prod
Browse files Browse the repository at this point in the history
  • Loading branch information
ynwd committed Dec 6, 2024
1 parent e76fe39 commit 45f09d0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions modules/socket/mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,11 @@ export default function socketModule(s: Fastro) {
}
};
socket.onclose = async () => {
const c = ctx.stores.get("connected");
if (!c) return;
const entries = c.entries().toArray();
const entries = connected.entries().toArray();
for (const key in entries) {
const [username, { value: { socket, data } }] = entries[key];
if (socket && socket.readyState !== WebSocket.OPEN) {
c.delete(username);
connected.delete(username);
await broadcastConnection({
type: "ping",
room: data.room,
Expand Down

0 comments on commit 45f09d0

Please sign in to comment.