Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
bouncer: rehandling on forwarding ws.my_events
Browse files Browse the repository at this point in the history
Signed-off-by: Yonle <[email protected]>
  • Loading branch information
Yonle committed Feb 18, 2024
1 parent 5a20102 commit b75f22a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bouncer.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ module.exports = (ws, req, onClose) => {
return ws.send(JSON.stringify(["OK", data[1]?.id, false, "rate-limited: request too fast."]));
}

lastEvent = Date.now();
ws.my_events.add(data[1]);

if (!ws.relays.size && !sessStarted) {
console.log(process.pid, `>>>`, `${ws.ip} executed ${data[0]} command for the first. Initializing session`);
newsess(ws);
sessStarted = true;
}

lastEvent = Date.now();

ws.my_events.add(data[1]);
bc(data, ws);
ws.send(JSON.stringify(["OK", data[1]?.id, true, ""]));
break;
Expand Down

0 comments on commit b75f22a

Please sign in to comment.