mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-18 15:55:05 +00:00
do not fire drain before any queries execute
This commit is contained in:
parent
e6fe115962
commit
f726bf29ef
@ -25,7 +25,7 @@ p.query = function(config, values, callback) {
|
||||
return q;
|
||||
}
|
||||
|
||||
p._pulseQueryQueue = function() {
|
||||
p._pulseQueryQueue = function(initialConnection) {
|
||||
if(!this._connected) {
|
||||
return;
|
||||
}
|
||||
@ -34,7 +34,9 @@ p._pulseQueryQueue = function() {
|
||||
}
|
||||
var query = this._queryQueue.shift();
|
||||
if(!query) {
|
||||
this.emit('drain');
|
||||
if(!initialConnection) {
|
||||
this.emit('drain');
|
||||
}
|
||||
return;
|
||||
}
|
||||
this._activeQuery = query;
|
||||
@ -65,7 +67,7 @@ var ctor = function(config) {
|
||||
connection._config = utils.normalizeConnectionInfo(config);
|
||||
connection.on('connect', function() {
|
||||
connection._connected = true;
|
||||
connection._pulseQueryQueue();
|
||||
connection._pulseQueryQueue(true);
|
||||
});
|
||||
|
||||
//proxy some events to active query
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user