不要怂,就是干,撸起袖子干!

Commit ee69489c by Jan Aagaard Meier

Merge pull request #4661 from robraux/postgres-connection-resets

Force the client to be reaped if an ECONNRESET is returned on query [postgres]
2 parents 0c8abdf7 c7b6d792
Showing with 6 additions and 0 deletions
...@@ -107,6 +107,12 @@ Query.prototype.run = function(sql) { ...@@ -107,6 +107,12 @@ Query.prototype.run = function(sql) {
}); });
query.on('error', function(err) { query.on('error', function(err) {
// set the client so that it will be reaped if the connection resets while executing
if(err.code === 'ECONNRESET') {
self.client._invalid = true;
}
receivedError = true; receivedError = true;
err.sql = sql; err.sql = sql;
reject(self.formatError(err)); reject(self.formatError(err));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!