datasquirel/bin/engine/utils/endConnection.js

15 lines
320 B
JavaScript
Raw Normal View History

2023-08-12 13:36:18 +00:00
// @ts-check
const mysql = require("mysql");
/**
* @param {mysql.Connection} connection - the active MYSQL connection
*/
module.exports = function endConnection(connection) {
if (connection.state !== "disconnected") {
connection.end((err) => {
console.log(err?.message);
});
}
};