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) => {
|
this.connectionPool.getConnection((err, connection) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
reject(err);
|
reject(err);
|
||||||
connection.release();
|
try { connection.release();}
|
||||||
|
catch (e) {
|
||||||
|
console.error("Failed to release mysql connection", err);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// Use old query
|
// Use old query
|
||||||
if (data == null) {
|
if (data == null) {
|
||||||
|
|
Loading…
Reference in a new issue