Created
January 23, 2014 16:19
-
-
Save kessler/8581533 to your computer and use it in GitHub Desktop.
pg bug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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