Update db conn info
This commit is contained in:
@@ -12,8 +12,8 @@
|
|||||||
|
|
||||||
let databaseConfig = {
|
let databaseConfig = {
|
||||||
host: "127.0.0.1",
|
host: "127.0.0.1",
|
||||||
user: "gtac-main",
|
user: "gtac_main",
|
||||||
pass: "QaH2rOP7BOBAkuX5V74EsOFi4uh5XO",
|
pass: "d8NEzoNIFadanisuKuzEgOSOxOjiG6",
|
||||||
name: "gtac_main",
|
name: "gtac_main",
|
||||||
port: 3306,
|
port: 3306,
|
||||||
usePersistentConnection: true,
|
usePersistentConnection: true,
|
||||||
@@ -24,15 +24,15 @@ let persistentDatabaseConnection = null;
|
|||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
|
||||||
function initDatabaseScript() {
|
function initDatabaseScript() {
|
||||||
console.log("[Asshat.Database]: Initializing database script ...");
|
logToConsole(LOG_DEBUG, "[Asshat.Database]: Initializing database script ...");
|
||||||
console.log("[Asshat.Database]: Database script initialized successfully!");
|
logToConsole(LOG_DEBUG, "[Asshat.Database]: Database script initialized successfully!");
|
||||||
}
|
}
|
||||||
|
|
||||||
// -------------------------------------------------------------------------
|
// -------------------------------------------------------------------------
|
||||||
|
|
||||||
function connectToDatabase() {
|
function connectToDatabase() {
|
||||||
if(persistentDatabaseConnection == null) {
|
if(persistentDatabaseConnection == null) {
|
||||||
console.log("[Asshat.Database] Initializing database connection ...");
|
logToConsole(LOG_DEBUG, "[Asshat.Database] Initializing database connection ...");
|
||||||
persistentDatabaseConnection = module.mysql.connect(databaseConfig.host, databaseConfig.user, databaseConfig.pass, databaseConfig.name, databaseConfig.port);
|
persistentDatabaseConnection = module.mysql.connect(databaseConfig.host, databaseConfig.user, databaseConfig.pass, databaseConfig.name, databaseConfig.port);
|
||||||
if(persistentDatabaseConnection.error) {
|
if(persistentDatabaseConnection.error) {
|
||||||
console.warn("[Asshat.Database] Database connection error: " + toString(persistentDatabaseConnection.error));
|
console.warn("[Asshat.Database] Database connection error: " + toString(persistentDatabaseConnection.error));
|
||||||
@@ -40,10 +40,10 @@ function connectToDatabase() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("[Asshat.Database] Database connection successful!");
|
logToConsole(LOG_DEBUG, "[Asshat.Database] Database connection successful!");
|
||||||
return persistentDatabaseConnection;
|
return persistentDatabaseConnection;
|
||||||
} else {
|
} else {
|
||||||
//console.log("[Asshat.Database] Using existing database connection.");
|
//logToConsole(LOG_DEBUG, "[Asshat.Database] Using existing database connection.");
|
||||||
return persistentDatabaseConnection;
|
return persistentDatabaseConnection;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user