Skip to content

Commit d1f3817

Browse files
committed
eslint and build fixes
1 parent f69ab81 commit d1f3817

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/cmap/connect.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export async function connect(options: ConnectionOptions): Promise<Connection> {
4444
await performInitialHandshake(connection, options);
4545
return connection;
4646
} catch (error) {
47-
connection?.destroy({ force: false });
47+
connection?.destroy();
4848
throw error;
4949
}
5050
}

src/mongo_client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,7 @@ export class MongoClient extends TypedEventEmitter<MongoClientEvents> {
552552
try {
553553
await promisify(callback => this.topology?.connect(options, callback))();
554554
} catch (error) {
555-
this.topology?.close({ force: true });
555+
this.topology?.close();
556556
throw error;
557557
}
558558
};

src/sdam/monitor.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ function resetMonitorState(monitor: Monitor) {
214214

215215
monitor[kCancellationToken].emit('cancel');
216216

217-
monitor.connection?.destroy({ force: true });
217+
monitor.connection?.destroy();
218218
monitor.connection = null;
219219
}
220220

@@ -247,7 +247,7 @@ function checkServer(monitor: Monitor, callback: Callback<Document | null>) {
247247
);
248248

249249
function onHeartbeatFailed(err: Error) {
250-
monitor.connection?.destroy({ force: true });
250+
monitor.connection?.destroy();
251251
monitor.connection = null;
252252

253253
monitor.emitAndLogHeartbeat(
@@ -366,13 +366,13 @@ function checkServer(monitor: Monitor, callback: Callback<Document | null>) {
366366
await performInitialHandshake(connection, monitor.connectOptions);
367367
return connection;
368368
} catch (error) {
369-
connection.destroy({ force: false });
369+
connection.destroy();
370370
throw error;
371371
}
372372
})().then(
373373
connection => {
374374
if (isInCloseState(monitor)) {
375-
connection.destroy({ force: true });
375+
connection.destroy();
376376
return;
377377
}
378378

@@ -479,7 +479,7 @@ export class RTTPinger {
479479
this.closed = true;
480480
clearTimeout(this[kMonitorId]);
481481

482-
this.connection?.destroy({ force: true });
482+
this.connection?.destroy();
483483
this.connection = undefined;
484484
}
485485
}
@@ -495,7 +495,7 @@ function measureRoundTripTime(rttPinger: RTTPinger, options: RTTPingerOptions) {
495495

496496
function measureAndReschedule(conn?: Connection) {
497497
if (rttPinger.closed) {
498-
conn?.destroy({ force: true });
498+
conn?.destroy();
499499
return;
500500
}
501501

@@ -529,7 +529,7 @@ function measureRoundTripTime(rttPinger: RTTPinger, options: RTTPingerOptions) {
529529
connection.command(ns('admin.$cmd'), { [commandName]: 1 }, undefined).then(
530530
() => measureAndReschedule(),
531531
() => {
532-
rttPinger.connection?.destroy({ force: true });
532+
rttPinger.connection?.destroy();
533533
rttPinger.connection = undefined;
534534
rttPinger[kRoundTripTime] = 0;
535535
return;

test/unit/error.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ describe('MongoErrors', () => {
361361
// cleanup the server before calling done
362362
const cleanup = err => {
363363
topology.close();
364-
done();
364+
done(err);
365365
};
366366

367367
if (err) {

0 commit comments

Comments
 (0)