Skip to content

Commit

Permalink
Clear active users on startup if lost connection handlers were not se…
Browse files Browse the repository at this point in the history
…t up
  • Loading branch information
goto-bus-stop committed Nov 30, 2023
1 parent a93b0a4 commit c9ed5f1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/SocketServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,11 @@ class SocketServer {
try {
await uw.socketServer.initLostConnections();
} catch (err) {
// No need to prevent startup for this
// No need to prevent startup for this.
// We do need to clear the `users` list because the lost connection handlers
// will not do so.
uw.socketServer.#logger.warn({ err }, 'could not initialise lost connections');
await uw.redis.del('users');
}
});

Expand Down

0 comments on commit c9ed5f1

Please sign in to comment.