datasquirel/engine/engine/utils/endConnection.js
2023-08-13 15:15:32 +01:00

17 lines
335 B
JavaScript

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