@@ -179,7 +179,8 @@ class Topology extends EventEmitter {
179
179
180
180
// timer management
181
181
monitorTimers : [ ] ,
182
- iterationTimers : [ ]
182
+ iterationTimers : [ ] ,
183
+ connectionTimers : [ ]
183
184
} ;
184
185
185
186
// amend options for server instance creation
@@ -339,6 +340,9 @@ class Topology extends EventEmitter {
339
340
this . s . iterationTimers . map ( timer => clearTimeout ( timer ) ) ;
340
341
this . s . iterationTimers = [ ] ;
341
342
343
+ this . s . connectionTimers . map ( timer => clearTimeout ( timer ) ) ;
344
+ this . s . connectionTimers = [ ] ;
345
+
342
346
if ( this . s . sessionPool ) {
343
347
this . s . sessions . forEach ( session => session . endSession ( ) ) ;
344
348
this . s . sessionPool . endAllPooledSessions ( ) ;
@@ -936,11 +940,11 @@ function createAndConnectServer(topology, serverDescription, connectDelay) {
936
940
937
941
if ( connectDelay ) {
938
942
const connectTimer = setTimeout ( ( ) => {
939
- removeTimerFrom ( connectTimer , topology . s . iterationTimers ) ;
943
+ removeTimerFrom ( connectTimer , topology . s . connectionTimers ) ;
940
944
server . connect ( ) ;
941
945
} , connectDelay ) ;
942
946
943
- topology . s . iterationTimers . push ( connectTimer ) ;
947
+ topology . s . connectionTimers . push ( connectTimer ) ;
944
948
return server ;
945
949
}
946
950
@@ -961,7 +965,7 @@ function resetServer(topology, serverDescription) {
961
965
const newServer = createAndConnectServer (
962
966
topology ,
963
967
serverDescription ,
964
- topology . s . heartbeatFrequencyMS
968
+ topology . s . minHeartbeatFrequencyMS
965
969
) ;
966
970
967
971
topology . s . servers . set ( serverDescription . address , newServer ) ;
0 commit comments