Skip to content

Commit

Permalink
fix: remove sessions from hub during shutdown
Browse files Browse the repository at this point in the history
Prevent misleading failed_server_msg metric growth happening during shutdown
  • Loading branch information
palkan committed Oct 31, 2024
1 parent 808f799 commit b8e98fd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions node/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -696,6 +696,10 @@ func (n *Node) Disconnect(s *Session) error {
}

if n.IsShuttingDown() {
// Make sure session is removed from hub, so we don't try to send
// broadcast messages to them
n.hub.RemoveSession(s)

if s.IsDisconnectable() {
return n.DisconnectNow(s)
}
Expand Down

0 comments on commit b8e98fd

Please sign in to comment.