We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 37b1aaf commit 03df7c1Copy full SHA for 03df7c1
lib/index.js
@@ -141,9 +141,8 @@ export default function Postgres(url, options) {
141
}
142
143
function next() {
144
- let x
145
- let c
146
- while ((x = queries.shift()) && (c = getConnection(x.fn))) {
+ let c, x
+ while (queries.length && (c = getConnection(queries.peek().fn)) && (x = queries.shift())) {
147
x.fn
148
? transaction(x, c)
149
: send(c, x.query, x.xs, x.args)
lib/queue.js
@@ -7,6 +7,7 @@ export default function Queue() {
7
return xs.length - index
8
},
9
push: (x) => xs.push(x),
10
+ peek: (x) => xs[index],
11
shift: () => {
12
if (index === xs.length) {
13
index = -1
0 commit comments