Skip to content

Commit ded413f

Browse files
authored
Fix reserved connection query handler (porsager#683)
1 parent e4b158b commit ded413f

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

cf/src/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ function Postgres(a, b) {
202202
}
203203

204204
async function reserve() {
205-
const q = Queue()
205+
const queue = Queue()
206206
const c = open.length
207207
? open.shift()
208208
: await new Promise(r => {
@@ -211,8 +211,8 @@ function Postgres(a, b) {
211211
})
212212

213213
move(c, reserved)
214-
c.reserved = () => q.length
215-
? c.execute(q.shift())
214+
c.reserved = () => queue.length
215+
? c.execute(queue.shift())
216216
: move(c, reserved)
217217
c.reserved.release = true
218218

@@ -226,7 +226,7 @@ function Postgres(a, b) {
226226

227227
function handler(q) {
228228
c.queue === full
229-
? q.push(q)
229+
? queue.push(q)
230230
: c.execute(q) || move(c, full)
231231
}
232232
}

cjs/src/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ function Postgres(a, b) {
201201
}
202202

203203
async function reserve() {
204-
const q = Queue()
204+
const queue = Queue()
205205
const c = open.length
206206
? open.shift()
207207
: await new Promise(r => {
@@ -210,8 +210,8 @@ function Postgres(a, b) {
210210
})
211211

212212
move(c, reserved)
213-
c.reserved = () => q.length
214-
? c.execute(q.shift())
213+
c.reserved = () => queue.length
214+
? c.execute(queue.shift())
215215
: move(c, reserved)
216216
c.reserved.release = true
217217

@@ -225,7 +225,7 @@ function Postgres(a, b) {
225225

226226
function handler(q) {
227227
c.queue === full
228-
? q.push(q)
228+
? queue.push(q)
229229
: c.execute(q) || move(c, full)
230230
}
231231
}

deno/src/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ function Postgres(a, b) {
202202
}
203203

204204
async function reserve() {
205-
const q = Queue()
205+
const queue = Queue()
206206
const c = open.length
207207
? open.shift()
208208
: await new Promise(r => {
@@ -211,8 +211,8 @@ function Postgres(a, b) {
211211
})
212212

213213
move(c, reserved)
214-
c.reserved = () => q.length
215-
? c.execute(q.shift())
214+
c.reserved = () => queue.length
215+
? c.execute(queue.shift())
216216
: move(c, reserved)
217217
c.reserved.release = true
218218

@@ -226,7 +226,7 @@ function Postgres(a, b) {
226226

227227
function handler(q) {
228228
c.queue === full
229-
? q.push(q)
229+
? queue.push(q)
230230
: c.execute(q) || move(c, full)
231231
}
232232
}

src/index.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ function Postgres(a, b) {
201201
}
202202

203203
async function reserve() {
204-
const q = Queue()
204+
const queue = Queue()
205205
const c = open.length
206206
? open.shift()
207207
: await new Promise(r => {
@@ -210,8 +210,8 @@ function Postgres(a, b) {
210210
})
211211

212212
move(c, reserved)
213-
c.reserved = () => q.length
214-
? c.execute(q.shift())
213+
c.reserved = () => queue.length
214+
? c.execute(queue.shift())
215215
: move(c, reserved)
216216
c.reserved.release = true
217217

@@ -225,7 +225,7 @@ function Postgres(a, b) {
225225

226226
function handler(q) {
227227
c.queue === full
228-
? q.push(q)
228+
? queue.push(q)
229229
: c.execute(q) || move(c, full)
230230
}
231231
}

0 commit comments

Comments
 (0)