slonik
Advanced tools
Comparing version 40.1.2 to 40.1.3
@@ -54,14 +54,9 @@ "use strict"; | ||
const onRelease = () => { | ||
if (!waitingClients.length) { | ||
const waitingClient = waitingClients.shift(); | ||
if (!waitingClient) { | ||
return; | ||
} | ||
if (connection.state() !== 'IDLE') { | ||
// TODO throw an error if this happens. | ||
// The connection was used by another client. | ||
return; | ||
throw new Error('Connection is not idle.'); | ||
} | ||
const waitingClient = waitingClients.shift(); | ||
if (!waitingClient) { | ||
return; | ||
} | ||
connection.acquire(); | ||
@@ -68,0 +63,0 @@ waitingClient.resolve(connection); |
@@ -97,3 +97,3 @@ { | ||
"types": "./dist/index.d.ts", | ||
"version": "40.1.2" | ||
"version": "40.1.3" | ||
} |
@@ -125,3 +125,5 @@ import { Logger } from '../Logger'; | ||
const onRelease = () => { | ||
if (!waitingClients.length) { | ||
const waitingClient = waitingClients.shift(); | ||
if (!waitingClient) { | ||
return; | ||
@@ -131,13 +133,5 @@ } | ||
if (connection.state() !== 'IDLE') { | ||
// TODO throw an error if this happens. | ||
// The connection was used by another client. | ||
return; | ||
throw new Error('Connection is not idle.'); | ||
} | ||
const waitingClient = waitingClients.shift(); | ||
if (!waitingClient) { | ||
return; | ||
} | ||
connection.acquire(); | ||
@@ -144,0 +138,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
1057281
18512