From 58ec53fb1dd8ac352d22a3641910e2250f545b40 Mon Sep 17 00:00:00 2001 From: Nelson Chan Date: Tue, 6 Jun 2023 20:28:51 +0800 Subject: [PATCH] Fix: Try to close mysql connection properly --- server/util-server.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/util-server.js b/server/util-server.js index 3e0306e61..daf98de62 100644 --- a/server/util-server.js +++ b/server/util-server.js @@ -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(); + } }); }); };