Skip to content

Commit 2248dfc

Browse files
W-A-Jamesnbbeeken
authored andcommitted
WIP - connect logic refactor
1 parent 3e9c86b commit 2248dfc

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/mongo_client.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -513,10 +513,7 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> {
513513
try {
514514
const skipPingOnConnect = this.s.options[Symbol.for('@@mdb.skipPingOnConnect')] === true;
515515
if (!skipPingOnConnect && !options?.skipPing && topology.s.credentials != null) {
516-
await this.db().admin().ping({ readPreference }); // performs server selection and sends ping
517-
topology.stateTransition(STATE_CONNECTED);
518-
topology.emit(Topology.OPEN, topology);
519-
topology.emit(Topology.CONNECT, topology);
516+
await this.db().admin().ping({ readPreference }); // goes through `executeOperation` so performs server selection
520517
}
521518
} catch (error) {
522519
topology.close();

0 commit comments

Comments
 (0)