diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/util/connections/ConnectionConfig.ts | 5 | ||||
-rw-r--r-- | src/util/connections/ConnectionLoader.ts | 19 |
2 files changed, 13 insertions, 11 deletions
diff --git a/src/util/connections/ConnectionConfig.ts b/src/util/connections/ConnectionConfig.ts index 4950ae90..7d1f9857 100644 --- a/src/util/connections/ConnectionConfig.ts +++ b/src/util/connections/ConnectionConfig.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ import { ConnectionConfigEntity } from "../entities/ConnectionConfigEntity"; let config: any; @@ -6,7 +7,7 @@ let pairs: ConnectionConfigEntity[]; export const ConnectionConfig = { init: async function init() { if (config) return config; - console.log("[ConnectionConfig] Loading configuration..."); + console.log("[Connections] Loading configuration..."); pairs = await ConnectionConfigEntity.find(); config = pairsToConfig(pairs); @@ -44,7 +45,7 @@ function applyConfig(val: any) { if (pair.value !== obj) { pair.value = obj; if (!pair.key || pair.key == null) { - console.log(`[ConnectionConfig] WARN: Empty key`); + console.log(`[Connections] WARN: Empty config key`); console.log(pair); } else return pair.save(); } diff --git a/src/util/connections/ConnectionLoader.ts b/src/util/connections/ConnectionLoader.ts index 0ca5b9e7..b32f77cd 100644 --- a/src/util/connections/ConnectionLoader.ts +++ b/src/util/connections/ConnectionLoader.ts @@ -1,6 +1,5 @@ import fs from "fs"; import path from "path"; -import { OrmUtils } from "../imports"; import Connection from "./Connection"; import { ConnectionConfig } from "./ConnectionConfig"; import { ConnectionStore } from "./ConnectionStore"; @@ -27,10 +26,11 @@ export class ConnectionLoader { ConnectionStore.connections.set(mod.id, mod); mod.init(); - console.log(`[Connections] Loaded connection '${mod.id}'`); + // console.log(`[Connections] Loaded connection '${mod.id}'`); }); } + // eslint-disable-next-line @typescript-eslint/no-explicit-any public static getConnectionConfig(id: string, defaults?: any): any { let cfg = ConnectionConfig.get()[id]; if (defaults) { @@ -41,21 +41,22 @@ export class ConnectionLoader { } } - if (!cfg) - console.log( - `[ConnectionConfig/WARN] Getting connection settings for '${id}' returned null! (Did you forget to add settings?)`, - ); + if (cfg?.enabled) console.log(`[Connections] ${id} enabled`); + + // if (!cfg) + // console.log( + // `[ConnectionConfig/WARN] Getting connection settings for '${id}' returned null! (Did you forget to add settings?)`, + // ); return cfg; } public static async setConnectionConfig( id: string, + // eslint-disable-next-line @typescript-eslint/no-explicit-any config: Partial<any>, ): Promise<void> { if (!config) - console.log( - `[ConnectionConfig/WARN] ${id} tried to set config=null!`, - ); + console.warn(`[Connections/WARN] ${id} tried to set config=null!`); await ConnectionConfig.set({ [id]: Object.assign( |