mirror of
https://example.com
synced 2024-11-28 22:56:38 +09:00
fix: 🐛 sonic logged connection despite not existing
This commit is contained in:
parent
46af585cf7
commit
1dbe44b211
1 changed files with 4 additions and 2 deletions
|
@ -5,8 +5,6 @@ import config from "@/config/index.js";
|
|||
|
||||
const logger = dbLogger.createSubLogger("sonic", "gray", false);
|
||||
|
||||
logger.info("Connecting to Sonic");
|
||||
|
||||
const handlers = (type: string): SonicChannel.Handlers => ({
|
||||
connected: () => {
|
||||
logger.succ(`Connected to Sonic ${type}`);
|
||||
|
@ -28,6 +26,10 @@ const handlers = (type: string): SonicChannel.Handlers => ({
|
|||
const hasConfig =
|
||||
config.sonic && (config.sonic.host || config.sonic.port || config.sonic.auth);
|
||||
|
||||
if (hasConfig) {
|
||||
logger.info("Connecting to Sonic");
|
||||
}
|
||||
|
||||
const host = hasConfig ? config.sonic.host ?? "localhost" : "";
|
||||
const port = hasConfig ? config.sonic.port ?? 1491 : 0;
|
||||
const auth = hasConfig ? config.sonic.auth ?? "SecretPassword" : "";
|
||||
|
|
Loading…
Reference in a new issue