File tree Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Expand file tree Collapse file tree 2 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -266,6 +266,7 @@ class NodeChannel {
266266 this . _open = true ;
267267 this . _error = null ;
268268 this . _handleConnectionError = this . _handleConnectionError . bind ( this ) ;
269+ this . _handleConnectionTerminated = this . _handleConnectionTerminated . bind ( this ) ;
269270
270271 this . _encrypted = opts . encrypted ;
271272 this . _conn = connect ( opts , ( ) => {
@@ -299,10 +300,8 @@ class NodeChannel {
299300 }
300301
301302 _handleConnectionTerminated ( ) {
302- this . _error = new Error ( 'Connection was closed by server' ) ;
303- if ( this . onerror ) {
304- this . onerror ( this . _error ) ;
305- }
303+ this . _open = false ;
304+ this . _conn = undefined ;
306305 }
307306
308307 isEncrypted ( ) {
Original file line number Diff line number Diff line change @@ -46,6 +46,8 @@ class Pool {
4646
4747 if ( this . _validate ( resource ) ) {
4848 return resource ;
49+ } else {
50+ this . _destroy ( resource ) ;
4951 }
5052 }
5153
You can’t perform that action at this time.
0 commit comments