Node-DBI icon indicating copy to clipboard operation
Node-DBI copied to clipboard

exception for "terminating connection due to administrator command"

Open VaoTsun opened this issue 11 years ago • 1 comments

this would bix a bug - when app hits max connections limit in pg db the whole app crashes with:

events.js:72 throw er; // Unhandled 'error' event ^ error: terminating connection due to administrator command

code is borrowed from https://github.com/sequelize/sequelize/issues/1854

VaoTsun avatar Jan 14 '15 08:01 VaoTsun

Hi, DBWrapper.close( function(err) {console.log('Connection closed !');} ); not working for me. which I did not investigate, so quite soon I hit max sessions in postgres. So I see mentioned throw er; // Unhandled 'error' event and my app crashes. This would happen when you restart db as well. and so on... this problem is common for pg clients. so I copied decision to your code - it is 3 lines

VaoTsun avatar Jan 14 '15 08:01 VaoTsun