fix: not sure why this order was weird

pull/243/head
Josh Moore 1 year ago
parent 2f883e39be
commit 5e6c918ec2

@ -25,15 +25,14 @@ export class MySql {
*/
public static configure(): Promise<void> {
return new Promise(async (resolve, reject) => {
try {
// Config check
if (!UserConfig.ready) throw new Error('User configuration not ready');
if (!UserConfig.config.sql?.mySql) throw new Error('MySQL configuration missing');
// Create the pool
MySql._pool = mysql.createPool(UserConfig.config.sql.mySql);
// Config check
if (!UserConfig.ready) throw new Error('User configuration not ready');
if (!UserConfig.config.sql?.mySql) throw new Error('MySQL configuration missing');
try {
// Create the pool
MySql._pool = mysql.createPool(UserConfig.config.sql.mySql);
// Check if the pool is usable
const [rowz, _fields] = await MySql._pool.query(`SHOW FULL TABLES WHERE Table_Type LIKE 'BASE TABLE';`);

Loading…
Cancel
Save