Skip to content

Commit

Permalink
Fix reserved connection query handler (#683)
Browse files Browse the repository at this point in the history
  • Loading branch information
Digifox03 authored Oct 10, 2023
1 parent e4b158b commit ded413f
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions cf/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ function Postgres(a, b) {
}

async function reserve() {
const q = Queue()
const queue = Queue()
const c = open.length
? open.shift()
: await new Promise(r => {
Expand All @@ -211,8 +211,8 @@ function Postgres(a, b) {
})

move(c, reserved)
c.reserved = () => q.length
? c.execute(q.shift())
c.reserved = () => queue.length
? c.execute(queue.shift())
: move(c, reserved)
c.reserved.release = true

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

function handler(q) {
c.queue === full
? q.push(q)
? queue.push(q)
: c.execute(q) || move(c, full)
}
}
Expand Down
8 changes: 4 additions & 4 deletions cjs/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function Postgres(a, b) {
}

async function reserve() {
const q = Queue()
const queue = Queue()
const c = open.length
? open.shift()
: await new Promise(r => {
Expand All @@ -210,8 +210,8 @@ function Postgres(a, b) {
})

move(c, reserved)
c.reserved = () => q.length
? c.execute(q.shift())
c.reserved = () => queue.length
? c.execute(queue.shift())
: move(c, reserved)
c.reserved.release = true

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

function handler(q) {
c.queue === full
? q.push(q)
? queue.push(q)
: c.execute(q) || move(c, full)
}
}
Expand Down
8 changes: 4 additions & 4 deletions deno/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ function Postgres(a, b) {
}

async function reserve() {
const q = Queue()
const queue = Queue()
const c = open.length
? open.shift()
: await new Promise(r => {
Expand All @@ -211,8 +211,8 @@ function Postgres(a, b) {
})

move(c, reserved)
c.reserved = () => q.length
? c.execute(q.shift())
c.reserved = () => queue.length
? c.execute(queue.shift())
: move(c, reserved)
c.reserved.release = true

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

function handler(q) {
c.queue === full
? q.push(q)
? queue.push(q)
: c.execute(q) || move(c, full)
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ function Postgres(a, b) {
}

async function reserve() {
const q = Queue()
const queue = Queue()
const c = open.length
? open.shift()
: await new Promise(r => {
Expand All @@ -210,8 +210,8 @@ function Postgres(a, b) {
})

move(c, reserved)
c.reserved = () => q.length
? c.execute(q.shift())
c.reserved = () => queue.length
? c.execute(queue.shift())
: move(c, reserved)
c.reserved.release = true

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

function handler(q) {
c.queue === full
? q.push(q)
? queue.push(q)
: c.execute(q) || move(c, full)
}
}
Expand Down

0 comments on commit ded413f

Please sign in to comment.