Skip to content

Commit

Permalink
fix: patch
Browse files Browse the repository at this point in the history
Signed-off-by: Ricardo Arturo Cabral Mejía <me@ricardocabral.io>
  • Loading branch information
cameri committed Feb 2, 2023
1 parent 280e24f commit b0adba6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/adapters/web-socket-server-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ export class WebSocketServerAdapter extends WebServerAdapter implements IWebSock
return
}
const webSocketAdapter = this.webSocketsAdapters.get(webSocket) as IWebSocketAdapter
if (!webSocketAdapter) {
return
}
webSocketAdapter.emit(WebSocketAdapterEvent.Event, event)
})
}
Expand Down
13 changes: 13 additions & 0 deletions src/database/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@ import 'pg-query-stream'
import knex, { Knex } from 'knex'
import { createLogger } from '../factories/logger-factory'

knex.Client.prototype.releaseConnection = function (connection) {
//debug('releasing connection to pool: %s', connection.__knexUid);
console.log('releasing connection to pool')
const didRelease = this.pool.release(connection)

if (!didRelease) {
console.log('pool refused connection')
//debug('pool refused connection: %s', connection.__knexUid);
}

return Promise.resolve()
}

const getMasterConfig = (): Knex.Config => ({
client: 'pg',
connection: {
Expand Down

0 comments on commit b0adba6

Please # to comment.