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) {
735
735
previousDescription := s .Description ()
736
736
streamable := previousDescription .TopologyVersion != nil
737
737
738
- isNilConn := s .conn == nil
739
- if ! isNilConn {
738
+ if s .conn != nil {
740
739
s .publishServerHeartbeatStartedEvent (s .conn .ID (), s .conn .getCurrentlyStreaming () || streamable )
741
740
}
742
741
// Create a new connection if this is the first check, the connection was closed after an error during the previous
743
742
// 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 () {
745
744
// Create a new connection and add it's handshake RTT as a sample.
746
745
err = s .setupHeartbeatConnection ()
747
746
if err == nil {
@@ -751,9 +750,7 @@ func (s *Server) check() (description.Server, error) {
751
750
} else {
752
751
err = unwrapConnectionError (err )
753
752
}
754
- }
755
-
756
- if ! isNilConn && err == nil {
753
+ } else {
757
754
// An existing connection is being used. Use the server description properties to execute the right heartbeat.
758
755
759
756
// Wrap conn in a type that implements driver.StreamerConnection.
You can’t perform that action at this time.
0 commit comments