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,