From ae095baad3a7b650916d34e51746524dea9c54a8 Mon Sep 17 00:00:00 2001 From: Zack Pollard Date: Wed, 12 Jun 2024 12:44:30 +0100 Subject: [PATCH] fix(server): only run healthchecks when api worker is running on immich-server (#10204) fix: only run healthchecks when api worker is running on immich-server --- server/src/utils/healthcheck.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/src/utils/healthcheck.ts b/server/src/utils/healthcheck.ts index df50636f45..763fce81b4 100644 --- a/server/src/utils/healthcheck.ts +++ b/server/src/utils/healthcheck.ts @@ -3,6 +3,10 @@ const port = Number(process.env.IMMICH_PORT) || 3001; const controller = new AbortController(); const main = async () => { + if (!process.env.IMMICH_WORKERS_INCLUDE?.includes('api')) { + process.exit(); + } + const timeout = setTimeout(() => controller.abort(), 2000); try { const response = await fetch(`http://localhost:${port}/api/server-info/ping`, {