Skip to content
This repository has been archived by the owner on Jul 14, 2023. It is now read-only.

Commit

Permalink
fix(pool): release client back to pool correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
vobu committed Aug 17, 2020
1 parent 8b23f3a commit 8027952
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,12 @@ module.exports = class PostgresDatabase extends HanaDatabase {
// .catch(err => {throw new PgError()}) // TODO: err handling -> pg-specific message?
}

release(dbc) {
// do release
return dbc.release()
/**
* release the query client back to the pool
* explicitly passing a truthy value
* see https://node-postgres.com/api/pool#releasecallback
*/
async release() {
return this.dbc.release(true)
}
}

0 comments on commit 8027952

Please sign in to comment.