File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -763,8 +763,7 @@ func (s *Server) check() (description.Server, error) {
763
763
if s .conn == nil || s .conn .closed () || s .checkWasCancelled () {
764
764
// Create a new connection if this is the first check, the connection was closed after an error during the previous
765
765
// check, or the previous check was cancelled.
766
- isNilConn := s .conn == nil
767
- if ! isNilConn {
766
+ if s .conn != nil {
768
767
s .publishServerHeartbeatStartedEvent (s .conn .ID (), false )
769
768
}
770
769
// Create a new connection and add it's handshake RTT as a sample.
@@ -774,12 +773,12 @@ func (s *Server) check() (description.Server, error) {
774
773
// Use the description from the connection handshake as the value for this check.
775
774
s .rttMonitor .addSample (s .conn .helloRTT )
776
775
descPtr = & s .conn .desc
777
- if ! isNilConn {
776
+ if s . conn != nil {
778
777
s .publishServerHeartbeatSucceededEvent (s .conn .ID (), duration , s .conn .desc , false )
779
778
}
780
779
} else {
781
780
err = unwrapConnectionError (err )
782
- if ! isNilConn {
781
+ if s . conn != nil {
783
782
s .publishServerHeartbeatFailedEvent (s .conn .ID (), duration , err , false )
784
783
}
785
784
}
You can’t perform that action at this time.
0 commit comments