Skip to content

Commit

Permalink
node 8 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
maximelkin committed Feb 20, 2020
1 parent 0d9d908 commit 1f08f7b
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/dialects/postgres/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,14 +279,14 @@ Object.assign(Client_PG.prototype, {
// Purposely not putting timeout on `pg_cancel_backend` execution because erroring
// early there would release the `connectionToKill` back to the pool with
// a `KILL QUERY` command yet to finish.
return acquiringConn.then((conn) => {
return this._wrappedCancelQueryCall(conn, connectionToKill).finally(
() => {
// NOT returning this promise because we want to release the connection
// in a non-blocking fashion
this.releaseConnection(conn);
}
);
return acquiringConn.then(async (conn) => {
try {
return await this._wrappedCancelQueryCall(conn, connectionToKill);
} finally {
// NOT returning this promise because we want to release the connection
// in a non-blocking fashion
this.releaseConnection(conn);
}
});
},
_wrappedCancelQueryCall(conn, connectionToKill) {
Expand Down

0 comments on commit 1f08f7b

Please sign in to comment.