File tree 1 file changed +6
-6
lines changed
1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -807,18 +807,18 @@ func (s *Server) check() (description.Server, error) {
807
807
// Create a new connection and add it's handshake RTT as a sample.
808
808
err = s .setupHeartbeatConnection ()
809
809
duration = time .Since (start )
810
+ connID = "0"
811
+ if s .conn != nil {
812
+ connID = s .conn .ID ()
813
+ }
810
814
if err == nil {
811
815
// Use the description from the connection handshake as the value for this check.
812
816
s .rttMonitor .addSample (s .conn .helloRTT )
813
817
descPtr = & s .conn .desc
814
- if s .conn != nil {
815
- s .publishServerHeartbeatSucceededEvent (s .conn .ID (), duration , s .conn .desc , false )
816
- }
818
+ s .publishServerHeartbeatSucceededEvent (connID , duration , s .conn .desc , false )
817
819
} else {
818
820
err = unwrapConnectionError (err )
819
- if s .conn != nil {
820
- s .publishServerHeartbeatFailedEvent (s .conn .ID (), duration , err , false )
821
- }
821
+ s .publishServerHeartbeatFailedEvent (connID , duration , err , false )
822
822
}
823
823
} else {
824
824
// An existing connection is being used. Use the server description properties to execute the right heartbeat.
You can’t perform that action at this time.
0 commit comments