File tree Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Expand file tree Collapse file tree 1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -735,13 +735,12 @@ func (s *Server) check() (description.Server, error) {
735735 previousDescription := s .Description ()
736736 streamable := previousDescription .TopologyVersion != nil
737737
738- isNilConn := s .conn == nil
739- if ! isNilConn {
738+ if s .conn != nil {
740739 s .publishServerHeartbeatStartedEvent (s .conn .ID (), s .conn .getCurrentlyStreaming () || streamable )
741740 }
742741 // Create a new connection if this is the first check, the connection was closed after an error during the previous
743742 // check, or the previous check was cancelled.
744- if isNilConn || s .conn .closed () || s .checkWasCancelled () {
743+ if s . conn == nil || s .conn .closed () || s .checkWasCancelled () {
745744 // Create a new connection and add it's handshake RTT as a sample.
746745 err = s .setupHeartbeatConnection ()
747746 if err == nil {
@@ -751,9 +750,7 @@ func (s *Server) check() (description.Server, error) {
751750 } else {
752751 err = unwrapConnectionError (err )
753752 }
754- }
755-
756- if ! isNilConn && err == nil {
753+ } else {
757754 // An existing connection is being used. Use the server description properties to execute the right heartbeat.
758755
759756 // Wrap conn in a type that implements driver.StreamerConnection.
You can’t perform that action at this time.
0 commit comments