Use load db config util
This commit is contained in:
@@ -16,10 +16,7 @@ let persistentDatabaseConnection = null;
|
|||||||
|
|
||||||
function initDatabaseScript() {
|
function initDatabaseScript() {
|
||||||
logToConsole(LOG_DEBUG, "[Asshat.Database]: Initializing database script ...");
|
logToConsole(LOG_DEBUG, "[Asshat.Database]: Initializing database script ...");
|
||||||
|
databaseConfiguration = loadDatabaseConfiguration();
|
||||||
let databaseConfigFile = loadTextFile("config/database.json");
|
|
||||||
databaseConfig = JSON.parse(databaseConfigFile);
|
|
||||||
|
|
||||||
logToConsole(LOG_DEBUG, "[Asshat.Database]: Database script initialized successfully!");
|
logToConsole(LOG_DEBUG, "[Asshat.Database]: Database script initialized successfully!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -175,3 +172,8 @@ function setConstantsAsGlobalVariablesInDatabase() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function loadDatabaseConfiguration() {
|
||||||
|
let databaseConfigFile = loadTextFile("config/database.json");
|
||||||
|
return JSON.parse(databaseConfigFile);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user