diff --git a/lib/client.js b/lib/client.js index 3104f70b..5800e943 100644 --- a/lib/client.js +++ b/lib/client.js @@ -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) {