slight readability refactor

This commit is contained in:
brianc 2011-02-04 18:51:23 -06:00
parent ab76f648b8
commit cb647935bb

View File

@ -66,10 +66,18 @@ p.connect = function() {
con.password(md5password);
});
con.on('readyForQuery', function() {
self.readyForQuery = true;
this.activeQuery = null;
self.pulseQueryQueue();
con.once('readyForQuery', function() {
//hook up query handling events to connection
//after the connection initially becomes ready for queries
var ready = function() {
self.readyForQuery = true;
this.activeQuery = null;
self.pulseQueryQueue();
};
con.on('readyForQuery', ready);
ready();
});
con.on('error', function(error) {