Skip to content

Commit

Permalink
Implement PR feedback
Browse files Browse the repository at this point in the history
Signed-off-by: Jean-Noël Moyne <jnmoyne@gmail.com>
  • Loading branch information
jnmoyne committed Aug 10, 2023
1 parent 3620796 commit 2de75dc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/server.go
Expand Up @@ -4253,7 +4253,7 @@ func (s *Server) changeRateLimitLogInterval(d time.Duration) {
}
}

// Disconnects a client by cid
// DisconnectClientByID disconnects a client by connection ID
func (s *Server) DisconnectClientByID(id uint64) error {
client := s.clients[id]
if client != nil {
Expand All @@ -4263,6 +4263,7 @@ func (s *Server) DisconnectClientByID(id uint64) error {
return errors.New("no such client id")
}

// LDMClientByID sends a Lame Duck Mode info message to a client by connection ID
func (s *Server) LDMClientByID(id uint64) error {
info := s.copyInfo()
info.LameDuckMode = true
Expand All @@ -4272,7 +4273,7 @@ func (s *Server) LDMClientByID(id uint64) error {
c.flags.isSet(firstPongSent) {
// sendInfo takes care of checking if the connection is still
// valid or not, so don't duplicate tests here.
s.Debugf("sending LDM info to cid=%d", id)
c.Debugf("sending Lame Duck Mode info to client")
c.enqueueProto(c.generateClientInfoJSON(info))
return nil
}
Expand Down

0 comments on commit 2de75dc

Please sign in to comment.