From 7c16fa7b42e8aac509659d5918d44994089d7b6e Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Wed, 1 Jan 2025 16:37:12 +0000 Subject: [PATCH] refactor: update ClickhouseConfig to use Hostname type for host configuration --- Common/Server/Infrastructure/ClickhouseConfig.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Common/Server/Infrastructure/ClickhouseConfig.ts b/Common/Server/Infrastructure/ClickhouseConfig.ts index 58cd6f3426f..2fbc4e0f0ad 100644 --- a/Common/Server/Infrastructure/ClickhouseConfig.ts +++ b/Common/Server/Infrastructure/ClickhouseConfig.ts @@ -11,13 +11,16 @@ import { ClickhouseUsername, ShouldClickhouseSslEnable, } from "../EnvironmentConfig"; +import Hostname from "../../Types/API/Hostname"; export type ClickHouseClientConfigOptions = NodeClickHouseClientConfigOptions; const hostProtocol: string = ClickHouseIsHostHttps ? "https" : "http"; +const clickhouseHost: Hostname = ClickhouseHost || new Hostname("clickhouse"); + const options: ClickHouseClientConfigOptions = { - url: `${hostProtocol}://${ClickhouseHost.toString()}:${ClickhousePort.toNumber()}`, + url: `${hostProtocol}://${clickhouseHost.toString()}:${ClickhousePort.toNumber()}`, username: ClickhouseUsername, password: ClickhousePassword, database: ClickhouseDatabase,