mirror of
https://github.com/brianc/node-postgres.git
synced 2026-02-01 16:47:23 +00:00
slight readability refactor
This commit is contained in:
parent
ab76f648b8
commit
cb647935bb
@ -66,10 +66,18 @@ p.connect = function() {
|
|||||||
con.password(md5password);
|
con.password(md5password);
|
||||||
});
|
});
|
||||||
|
|
||||||
con.on('readyForQuery', function() {
|
con.once('readyForQuery', function() {
|
||||||
self.readyForQuery = true;
|
//hook up query handling events to connection
|
||||||
this.activeQuery = null;
|
//after the connection initially becomes ready for queries
|
||||||
self.pulseQueryQueue();
|
var ready = function() {
|
||||||
|
self.readyForQuery = true;
|
||||||
|
this.activeQuery = null;
|
||||||
|
self.pulseQueryQueue();
|
||||||
|
};
|
||||||
|
|
||||||
|
con.on('readyForQuery', ready);
|
||||||
|
ready();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
con.on('error', function(error) {
|
con.on('error', function(error) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user