We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 608cb83 commit 9a19244Copy full SHA for 9a19244
src/sdam/topology.ts
@@ -473,17 +473,13 @@ export class Topology extends TypedEventEmitter<TopologyEvents> {
473
474
const skipPingOnConnect = this.s.options[Symbol.for('@@mdb.skipPingOnConnect')] === true;
475
if (!skipPingOnConnect && server && this.s.credentials) {
476
- server.command(ns('admin.$cmd'), { ping: 1 }, {}, err => {
477
- if (err) {
478
- return exitWithError(err);
479
- }
480
-
+ server.commandAsync(ns('admin.$cmd'), { ping: 1 }, {}).then(() => {
481
stateTransition(this, STATE_CONNECTED);
482
this.emit(Topology.OPEN, this);
483
this.emit(Topology.CONNECT, this);
484
485
callback?.(undefined, this);
486
- });
+ }, exitWithError);
487
488
return;
489
}
0 commit comments