Merge pull request #3222 from chakflying/fix/mysql-aborted-connection

Fix: Try to close mysql connection properly
This commit is contained in:
Louis Lam 2023-06-08 00:26:18 +08:00 committed by GitHub
commit 37031fb9a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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();
}
});
});
};