Fix: Try to close mysql connection properly

This commit is contained in:
Nelson Chan 2023-06-06 20:28:51 +08:00
parent 4b3a2ee71b
commit 58ec53fb1d
1 changed files with 6 additions and 1 deletions

View File

@ -342,7 +342,12 @@ exports.mysqlQuery = function (connectionString, query) {
resolve("No Error, but the result is not an array. Type: " + typeof res);
}
}
connection.destroy();
try {
connection.end();
} catch (_) {
connection.destroy();
}
});
});
};