Skip to content

Instantly share code, notes, and snippets.

@kessler
Created January 23, 2014 16:19
Show Gist options
  • Select an option

  • Save kessler/8581533 to your computer and use it in GitHub Desktop.

Select an option

Save kessler/8581533 to your computer and use it in GitHub Desktop.
pg bug
var pg = require('pg')
var connectionString = 'your connection string here'
pg.defaults.poolSize = 2
var executedCount = 0
function query() {
pg.connect(connectionString, function (err, conn, done) {
conn.query('select 1+1', function (err, results) {
console.log(++executedCount)
done(1)
})
})
}
console.log('dont let the process exit after two queries')
setTimeout(function() {
console.log('timed out')
}, 10000)
query()
query()
query()
query()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment