Skip to content

Commit ecbbc4b

Browse files
committed
Fix close to not hang when there are no pending queries
1 parent fc05642 commit ecbbc4b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: postgres.js

+5
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,11 @@ exports.Connection = function (database, username, password, port, host) {
305305
};
306306
this.close = function () {
307307
closeState = true;
308+
309+
// Close the connection right away if there are no pending queries
310+
if (readyState) {
311+
connection.close();
312+
}
308313
};
309314
};
310315

0 commit comments

Comments
 (0)