不要怂,就是干,撸起袖子干!

Commit fea0ca73 by Sushant Committed by GitHub

fix(memory-utilization): don't keep bounded reference of connection manager (#8760)

1 parent b4fd4642
Showing with 3 additions and 6 deletions
......@@ -43,9 +43,9 @@ class ConnectionManager {
Promise
});
// Save a reference to the bound version so we can remove it with removeListener
this._onProcessExit = this._onProcessExit.bind(this);
process.on('exit', this._onProcessExit);
process.on('beforeExit', () => {
this._onProcessExit.call(this);
});
this.initPools();
}
......@@ -85,9 +85,6 @@ class ConnectionManager {
* @return {Promise}
*/
close() {
// Remove the listener, so all references to this instance can be garbage collected.
process.removeListener('exit', this._onProcessExit);
// Mark close of pool
this.getConnection = function getConnection() {
return Promise.reject(new Error('ConnectionManager.getConnection was called after the connection manager was closed!'));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!