Skip to content

Commit

Permalink
refactor: remove redundant pool clear calls
Browse files Browse the repository at this point in the history
  • Loading branch information
dariakp committed Aug 29, 2022
1 parent 0601162 commit 83d2a21
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
6 changes: 0 additions & 6 deletions src/sdam/monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,6 @@ function checkServer(monitor: Monitor, callback: Callback<Document | null>) {
);

monitor.emit('resetServer', err);
monitor.emit('resetConnectionPool');
callback(err);
}

Expand Down Expand Up @@ -306,11 +305,6 @@ function checkServer(monitor: Monitor, callback: Callback<Document | null>) {
if (err) {
monitor[kConnection] = undefined;

// we already reset the connection pool on network errors in all cases
if (!(err instanceof MongoNetworkError)) {
monitor.emit('resetConnectionPool');
}

failureHandler(err);
return;
}
Expand Down
4 changes: 0 additions & 4 deletions src/sdam/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,6 @@ export class Server extends TypedEventEmitter<ServerEvents> {
monitor.on(event, (e: any) => this.emit(event, e));
}

monitor.on('resetConnectionPool', () => {
this.s.pool.clear();
});

monitor.on('resetServer', (error: MongoError) => markServerUnknown(this, error));
monitor.on(Server.SERVER_HEARTBEAT_SUCCEEDED, (event: ServerHeartbeatSucceededEvent) => {
this.emit(
Expand Down

0 comments on commit 83d2a21

Please sign in to comment.