Skip to content

Commit

Permalink
refactor: update ClickhouseConfig to use Hostname type for host confi…
Browse files Browse the repository at this point in the history
…guration
  • Loading branch information
simlarsen committed Jan 1, 2025
1 parent 5ba526d commit 7c16fa7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Common/Server/Infrastructure/ClickhouseConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7c16fa7

Please sign in to comment.