mirror of
https://github.com/brianc/node-postgres.git
synced 2025-12-08 20:16:25 +00:00
Minor cleanup - inline throwOnRelease() (#129)
The throwOnRelease() function does not appear to be exposed anywhere, and it does not appear to make any sense to have it as a standalone func, as it ovecomplicates things and makes function call as non-returning. Inlined it.
This commit is contained in:
parent
70d5c09958
commit
2d2a87392c
6
index.js
6
index.js
@ -25,10 +25,6 @@ class PendingItem {
|
||||
}
|
||||
}
|
||||
|
||||
function throwOnRelease () {
|
||||
throw new Error('Release called on client which has already been released to the pool.')
|
||||
}
|
||||
|
||||
function promisify (Promise, callback) {
|
||||
if (callback) {
|
||||
return { callback: callback, result: undefined }
|
||||
@ -248,7 +244,7 @@ class Pool extends EventEmitter {
|
||||
|
||||
client.release = (err) => {
|
||||
if (released) {
|
||||
throwOnRelease()
|
||||
throw new Error('Release called on client which has already been released to the pool.')
|
||||
}
|
||||
|
||||
released = true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user