Skip to content

Commit 708fa4f

Browse files
committed
Fix end promise
1 parent 9bd8507 commit 708fa4f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,10 +319,10 @@ function Postgres(url, options) {
319319
let destroy
320320

321321
if (timeout === 0)
322-
return ended = Promise.all(all.map(c => c.destroy()))
322+
return ended = Promise.all(all.map(c => c.destroy())).then(() => undefined)
323323

324324
return ended = Promise.race([
325-
all.map(c => c.end())
325+
Promise.all(all.map(c => c.end()))
326326
].concat(
327327
timeout > 0
328328
? new Promise(r => destroy = setTimeout(() => (all.map(c => c.destroy()), r()), timeout * 1000))

0 commit comments

Comments
 (0)