Skip to content

Commit

Permalink
update the way to delete expired connections
Browse files Browse the repository at this point in the history
  • Loading branch information
mzzsfy committed Jan 8, 2024
1 parent 1d3093c commit 0cf11ef
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions statsviz.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,12 @@ func (s *Server) callData() {
}
if del {
s.lock.Lock()
for i, f := range onData {
if f == nil {
l := len(onData)
for i := 0; i < l; i++ {
if onData[i] == nil {
onData = append(onData[:i], onData[i+1:]...)
i--
l--
}
}
s.onData = onData
Expand Down

0 comments on commit 0cf11ef

Please sign in to comment.