js client emits 'connect' event
This commit is contained in:
parent
08eddd26e2
commit
7f5f554503
@ -78,7 +78,8 @@ p.connect = function() {
|
||||
con.sync();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
self.emit('connect');
|
||||
});
|
||||
|
||||
con.on('readyForQuery', function() {
|
||||
|
@ -15,7 +15,7 @@ var connect = function(config, callback) {
|
||||
client.connect();
|
||||
|
||||
var onError = function(error) {
|
||||
client.connection.removeListener('readyForQuery', onReady);
|
||||
client.removeListener('connect', onReady);
|
||||
callback(error);
|
||||
}
|
||||
|
||||
@ -30,7 +30,7 @@ var connect = function(config, callback) {
|
||||
//TODO refactor
|
||||
//i don't like reaching into the client's connection for attaching
|
||||
//to specific events here
|
||||
client.connection.once('readyForQuery', onReady);
|
||||
client.once('connect', onReady);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user