This commit is contained in:
Holly Stubbs 2022-04-23 12:11:31 +01:00
parent 58aa2f6b47
commit 7f8ea1f843
Signed by: tgpholly
GPG Key ID: B8583C4B7D18119E
1 changed files with 2 additions and 1 deletions

3
EUS.js
View File

@ -69,6 +69,7 @@ class Database {
} }
} }
let dbConnection;
function init() { function init() {
// Require node modules // Require node modules
node_modules["chalk"] = require("chalk"); node_modules["chalk"] = require("chalk");
@ -114,7 +115,7 @@ function init() {
} }
// This is using a callback but that's fine, the server will just react properly to the db not being ready yet. // This is using a callback but that's fine, the server will just react properly to the db not being ready yet.
const dbConnection = new Database(eusConfig["database"]["databaseAddress"], eusConfig["database"]["databasePort"], eusConfig["database"]["databaseUsername"], eusConfig["database"]["databasePassword"], eusConfig["database"]["databaseName"], async () => { dbConnection = new Database(eusConfig["database"]["databaseAddress"], eusConfig["database"]["databasePort"], eusConfig["database"]["databaseUsername"], eusConfig["database"]["databasePassword"], eusConfig["database"]["databaseName"], async () => {
cacheJSON = JSON.stringify(await cacheFilesAndSpace()); cacheJSON = JSON.stringify(await cacheFilesAndSpace());
cacheIsReady = true; cacheIsReady = true;
}); });