From 3551407d95702762575fc12998348e0a7e105973 Mon Sep 17 00:00:00 2001 From: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com> Date: Sun, 3 Nov 2024 03:46:16 +0100 Subject: [PATCH] fix: healthcheck if custom host is set (#13887) --- server/src/bin/healthcheck.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/bin/healthcheck.ts b/server/src/bin/healthcheck.ts index 6de58c2002..2613ee6a19 100644 --- a/server/src/bin/healthcheck.ts +++ b/server/src/bin/healthcheck.ts @@ -3,7 +3,7 @@ import { ImmichWorker } from 'src/enum'; import { ConfigRepository } from 'src/repositories/config.repository'; const main = async () => { - const { workers, port } = new ConfigRepository().getEnv(); + const { host, workers, port } = new ConfigRepository().getEnv(); if (!workers.includes(ImmichWorker.API)) { process.exit(); } @@ -11,7 +11,7 @@ const main = async () => { const controller = new AbortController(); const timeout = setTimeout(() => controller.abort(), 2000); try { - const response = await fetch(`http://localhost:${port}/api/server/ping`, { + const response = await fetch(`http://${host || 'localhost'}:${port}/api/server/ping`, { signal: controller.signal, });