Add try catch to connection.release so it can't crash the server
This commit is contained in:
parent
68c0f1a880
commit
82bef6018b
1 changed files with 4 additions and 1 deletions
|
@ -19,7 +19,10 @@ module.exports = class {
|
|||
this.connectionPool.getConnection((err, connection) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
connection.release();
|
||||
try { connection.release();}
|
||||
catch (e) {
|
||||
console.error("Failed to release mysql connection", err);
|
||||
}
|
||||
} else {
|
||||
// Use old query
|
||||
if (data == null) {
|
||||
|
|
Loading…
Reference in a new issue