dsql-admin/dsql-app/package-shared/utils/endConnection.js

17 lines
351 B
JavaScript
Raw Permalink Normal View History

2024-12-06 13:24:26 +00:00
// @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;