mirror of
https://github.com/Cameri/nostream.git
synced 2025-03-17 21:31:48 +01:00
chore: reduce logging
Signed-off-by: Ricardo Arturo Cabral Mejía <me@ricardocabral.io>
This commit is contained in:
parent
ad7ab69d36
commit
199fa55ea3
@ -4,11 +4,15 @@ import knex, { Knex } from 'knex'
|
||||
import { createLogger } from '../factories/logger-factory'
|
||||
|
||||
((knex) => {
|
||||
const counters = {}
|
||||
knex.Client.prototype.releaseConnection = function (connection) {
|
||||
const released = this.pool.release(connection)
|
||||
|
||||
if (released) {
|
||||
console.log(`${this.config.tag} conneciton pool: ${this.pool.numUsed()} used / ${this.pool.numFree()} free / ${this.pool.numPendingAcquires()} pending`)
|
||||
counters[this.config.tag] = (counters[this.config.tag] ?? 0) + 1
|
||||
if (counters[this.config.tag] % 10 === 0) {
|
||||
console.log(`${this.config.tag} connection pool: ${this.pool.numUsed()} used / ${this.pool.numFree()} free / ${this.pool.numPendingAcquires()} pending`)
|
||||
}
|
||||
}
|
||||
|
||||
return Promise.resolve()
|
||||
|
Loading…
x
Reference in New Issue
Block a user