File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -4,11 +4,15 @@ import knex, { Knex } from 'knex'
44import { createLogger } from '../factories/logger-factory'
55
66( ( knex ) => {
7+ const counters = { }
78 knex . Client . prototype . releaseConnection = function ( connection ) {
89 const released = this . pool . release ( connection )
910
1011 if ( released ) {
11- console . log ( `${ this . config . tag } conneciton pool: ${ this . pool . numUsed ( ) } used / ${ this . pool . numFree ( ) } free / ${ this . pool . numPendingAcquires ( ) } pending` )
12+ counters [ this . config . tag ] = ( counters [ this . config . tag ] ?? 0 ) + 1
13+ if ( counters [ this . config . tag ] % 10 === 0 ) {
14+ console . log ( `${ this . config . tag } connection pool: ${ this . pool . numUsed ( ) } used / ${ this . pool . numFree ( ) } free / ${ this . pool . numPendingAcquires ( ) } pending` )
15+ }
1216 }
1317
1418 return Promise . resolve ( )
You can’t perform that action at this time.
0 commit comments