mirror of
https://github.com/brianc/node-postgres.git
synced 2026-01-18 15:55:05 +00:00
Working on disconnect issue
This commit is contained in:
parent
3a7b226fe3
commit
72560850d7
@ -409,17 +409,15 @@ Client.prototype.query = function(config, values, callback) {
|
||||
|
||||
Client.prototype.end = function(cb) {
|
||||
this._ending = true;
|
||||
if (this.activeQuery) {
|
||||
return this.connection.stream.end()
|
||||
}
|
||||
this.connection.end();
|
||||
if (cb) {
|
||||
this.connection.once('end', cb);
|
||||
} else {
|
||||
return new global.Promise((resolve) => {
|
||||
this.connection.once('end', resolve);
|
||||
});
|
||||
this.connection.end();
|
||||
return;
|
||||
}
|
||||
return new global.Promise((resolve) => {
|
||||
this.connection.end();
|
||||
this.connection.once('end', resolve);
|
||||
});
|
||||
};
|
||||
|
||||
Client.md5 = function(string) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user