Skip to content

Commit

Permalink
improve comments
Browse files Browse the repository at this point in the history
  • Loading branch information
maciuszek committed Jan 3, 2025
1 parent 9c6f78f commit 25cd271
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net_sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ func (s *netSink) run() {
// writeToConn will set s.conn to nil on error, try to reconnect
if s.conn == nil {
// connect to statsd server
// the connection will be persisted unless an error occurs. thereby with batching is used the entire batch will be streamed under 1 connection
// the connection will be persisted unless an error occurs. thereby when batching is used the entire batch will be streamed under 1 connection
if err := s.connect(addr); err != nil {
s.log.Warnf("connection error: %s", err)

Expand All @@ -324,7 +324,7 @@ func (s *netSink) run() {
s.mu.Unlock()
}
putBuffer(buf)
continue // if error we may need to reconnect so go back to the top of the next iteration
continue // we will need to reconnect if an error occurs, so go back to the top of the next iteration to see
default:
// Drop through in case retryc has nothing.
}
Expand Down Expand Up @@ -354,8 +354,8 @@ func (s *netSink) run() {
} else {
batchInterval = time.After(batchTimeout)
}

default:
// No need to block here, drop through check again in the next t.C interval
}
// drain all outc data. either batch or send immediatedly
case done := <-s.doFlush:
Expand Down

0 comments on commit 25cd271

Please sign in to comment.