File tree 2 files changed +5
-16
lines changed
2 files changed +5
-16
lines changed Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ class Pool extends EventEmitter {
127
127
}
128
128
for ( let i = 0 ; i < this . _allConnections . length ; i ++ ) {
129
129
connection = this . _allConnections . get ( i ) ;
130
- connection . _realEnd ( endCB ) ;
130
+ connection . end ( endCB ) ;
131
131
}
132
132
}
133
133
@@ -205,7 +205,7 @@ class Pool extends EventEmitter {
205
205
Date . now ( ) - this . _freeConnections . get ( 0 ) . lastActiveTime >
206
206
this . config . idleTimeout )
207
207
) {
208
- this . _freeConnections . get ( 0 ) . _realEnd ( ) ;
208
+ this . _freeConnections . get ( 0 ) . end ( ) ;
209
209
}
210
210
} finally {
211
211
this . _removeIdleTimeoutConnections ( ) ;
Original file line number Diff line number Diff line change @@ -34,17 +34,9 @@ class PoolConnection extends Connection {
34
34
return new PromisePoolConnection ( this , promiseImpl ) ;
35
35
}
36
36
37
- end ( ) {
38
- const err = new Error (
39
- 'Calling conn.end() to release a pooled connection is ' +
40
- 'deprecated. In next version calling conn.end() will be ' +
41
- 'restored to default conn.end() behavior. Use ' +
42
- 'conn.release() instead.'
43
- ) ;
44
- this . emit ( 'warn' , err ) ;
45
- // eslint-disable-next-line no-console
46
- console . warn ( err . message ) ;
47
- this . release ( ) ;
37
+ end ( callback ) {
38
+ this . _removeFromPool ( ) ;
39
+ super . end ( callback ) ;
48
40
}
49
41
50
42
destroy ( ) {
@@ -64,6 +56,3 @@ class PoolConnection extends Connection {
64
56
65
57
PoolConnection . statementKey = Connection . statementKey ;
66
58
module . exports = PoolConnection ;
67
-
68
- // TODO: Remove this when we are removing PoolConnection#end
69
- PoolConnection . prototype . _realEnd = Connection . prototype . end ;
You can’t perform that action at this time.
0 commit comments