diff --git a/database/accounts/accounts.js b/database/accounts/accounts.js index 84c7a35..d33d11f 100644 --- a/database/accounts/accounts.js +++ b/database/accounts/accounts.js @@ -27,7 +27,7 @@ async function checkForAdminAccount() { console.log("Created temp admin account 'admin@example.com' with password 'admin'."); } } -checkForAdminAccount(); +database.initializationStatus.then(() => checkForAdminAccount()); passport.use(new localStrategy({ diff --git a/database/database.js b/database/database.js index 349e2bc..7390426 100644 --- a/database/database.js +++ b/database/database.js @@ -36,10 +36,11 @@ async function checkForDatabaseInitialization() { await Initialize(); } } -checkForDatabaseInitialization(); +const initializationStatus = checkForDatabaseInitialization(); -exports.executeQuery = executeQuery; \ No newline at end of file +exports.executeQuery = executeQuery; +exports.initializationStatus = initializationStatus; \ No newline at end of file