File tree Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Expand file tree Collapse file tree 1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,6 @@ import {
46
46
makeStateMachine ,
47
47
noop ,
48
48
now ,
49
- ns ,
50
49
promiseWithResolvers ,
51
50
shuffle
52
51
} from '../utils' ;
@@ -469,15 +468,9 @@ export class Topology extends TypedEventEmitter<TopologyEvents> {
469
468
readPreferenceServerSelector ( readPreference ) ,
470
469
selectServerOptions
471
470
) ;
472
- const skipPingOnConnect = this . s . options . __skipPingOnConnect === true ;
473
- if ( ! skipPingOnConnect && this . s . credentials ) {
474
- await server . command ( ns ( 'admin.$cmd' ) , { ping : 1 } , { timeoutContext } ) ;
475
- stateTransition ( this , STATE_CONNECTED ) ;
476
- this . emit ( Topology . OPEN , this ) ;
477
- this . emit ( Topology . CONNECT , this ) ;
478
-
479
- return this ;
480
- }
471
+
472
+ const connection = await server . pool . checkOut ( { timeoutContext : timeoutContext } ) ;
473
+ server . pool . checkIn ( connection ) ;
481
474
482
475
stateTransition ( this , STATE_CONNECTED ) ;
483
476
this . emit ( Topology . OPEN , this ) ;
You can’t perform that action at this time.
0 commit comments