1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-27 10:58:13 +02:00

fix: healthcheck if custom host is set (#13887)

This commit is contained in:
Daniel Dietzler 2024-11-03 03:46:16 +01:00 committed by GitHub
parent 6bfc20ef95
commit 3551407d95
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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,
});