Skip to content

Commit 26368d8

Browse files
committed
Use 0 for nil connection.
1 parent eb7d5d3 commit 26368d8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

x/mongo/driver/topology/server.go

+5
Original file line numberDiff line numberDiff line change
@@ -799,6 +799,11 @@ func (s *Server) check() (description.Server, error) {
799799
// Create a new connection if this is the first check, the connection was closed after an error during the previous
800800
// check, or the previous check was cancelled.
801801
if s.conn == nil || s.conn.closed() || s.checkWasCancelled() {
802+
connID := "0"
803+
if s.conn != nil {
804+
connID = s.conn.ID()
805+
}
806+
s.publishServerHeartbeatStartedEvent(connID, false)
802807
// Create a new connection and add it's handshake RTT as a sample.
803808
err = s.setupHeartbeatConnection()
804809
duration = time.Since(start)

0 commit comments

Comments
 (0)