We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a6ff574 commit 3e2ef86Copy full SHA for 3e2ef86
1 file changed
src/sdam/topology.ts
@@ -469,8 +469,16 @@ export class Topology extends TypedEventEmitter<TopologyEvents> {
469
selectServerOptions
470
);
471
472
- const connection = await server.pool.checkOut({ timeoutContext: timeoutContext });
473
- server.pool.checkIn(connection);
+ const skipPingOnConnect = this.s.options.__skipPingOnConnect === true;
+ if (!skipPingOnConnect && this.s.credentials) {
474
+ const connection = await server.pool.checkOut({ timeoutContext: timeoutContext });
475
+ server.pool.checkIn(connection);
476
+ stateTransition(this, STATE_CONNECTED);
477
+ this.emit(Topology.OPEN, this);
478
+ this.emit(Topology.CONNECT, this);
479
+
480
+ return this;
481
+ }
482
483
stateTransition(this, STATE_CONNECTED);
484
this.emit(Topology.OPEN, this);
0 commit comments