Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pg-pool

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pg-pool - npm Package Compare versions

Comparing version 3.5.1 to 3.5.2

35

index.js

@@ -255,3 +255,3 @@ 'use strict'

if (this.options.maxLifetimeSeconds !== 0) {
setTimeout(() => {
const maxLifetimeTimeout = setTimeout(() => {
this.log('ending client due to expired lifetime')

@@ -269,2 +269,5 @@ this._expired.add(client)

}, this.options.maxLifetimeSeconds * 1000)
maxLifetimeTimeout.unref()
client.once('end', () => clearTimeout(maxLifetimeTimeout))
}

@@ -408,16 +411,20 @@

this.log('dispatching query')
client.query(text, values, (err, res) => {
this.log('query dispatched')
client.removeListener('error', onError)
if (clientReleased) {
return
}
clientReleased = true
try {
client.query(text, values, (err, res) => {
this.log('query dispatched')
client.removeListener('error', onError)
if (clientReleased) {
return
}
clientReleased = true
client.release(err)
if (err) {
return cb(err)
}
return cb(undefined, res)
})
} catch (err) {
client.release(err)
if (err) {
return cb(err)
} else {
return cb(undefined, res)
}
})
return cb(err)
}
})

@@ -424,0 +431,0 @@ return response.result

4

package.json
{
"name": "pg-pool",
"version": "3.5.1",
"version": "3.5.2",
"description": "Connection pool for node-postgres",

@@ -40,3 +40,3 @@ "main": "index.js",

},
"gitHead": "4fa7ee891a456168a75695ac026792136f16577f"
"gitHead": "c99fb2c127ddf8d712500db2c7b9a5491a178655"
}

@@ -40,2 +40,14 @@ 'use strict'

it('Catches errors in client.query', async function () {
let caught = false
const pool = new Pool()
try {
await pool.query(null)
} catch (e) {
caught = true
}
pool.end()
expect(caught).to.be(true)
})
describe('calling release more than once', () => {

@@ -42,0 +54,0 @@ it(

@@ -6,3 +6,3 @@ // This test is meant to be spawned from idle-timeout.js

const pool = new Pool({ idleTimeoutMillis: 200, ...(allowExitOnIdle ? { allowExitOnIdle: true } : {}) })
const pool = new Pool({ maxLifetimeSeconds: 2, idleTimeoutMillis: 200, ...(allowExitOnIdle ? { allowExitOnIdle: true } : {}) })
pool.query('SELECT NOW()', (err, res) => console.log('completed first'))

@@ -9,0 +9,0 @@ pool.on('remove', () => {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc