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 {
4646 makeStateMachine ,
4747 noop ,
4848 now ,
49- ns ,
5049 promiseWithResolvers ,
5150 shuffle
5251} from '../utils' ;
@@ -469,15 +468,9 @@ export class Topology extends TypedEventEmitter<TopologyEvents> {
469468 readPreferenceServerSelector ( readPreference ) ,
470469 selectServerOptions
471470 ) ;
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 ) ;
481474
482475 stateTransition ( this , STATE_CONNECTED ) ;
483476 this . emit ( Topology . OPEN , this ) ;
You can’t perform that action at this time.
0 commit comments