Skip to content

Commit

Permalink
fix: healthcheck if custom host is set (immich-app#13887)
Browse files Browse the repository at this point in the history
  • Loading branch information
danieldietzler authored Nov 3, 2024
1 parent 6bfc20e commit 3551407
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/src/bin/healthcheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ 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();
}

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

Expand Down

0 comments on commit 3551407

Please sign in to comment.