1
0
mirror of https://github.com/immich-app/immich.git synced 2024-11-24 08:52:28 +02:00

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
This commit is contained in:
Zack Pollard 2024-06-12 12:44:30 +01:00 committed by GitHub
parent f99f289f74
commit ae095baad3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,6 +3,10 @@ const port = Number(process.env.IMMICH_PORT) || 3001;
const controller = new AbortController(); const controller = new AbortController();
const main = async () => { const main = async () => {
if (!process.env.IMMICH_WORKERS_INCLUDE?.includes('api')) {
process.exit();
}
const timeout = setTimeout(() => controller.abort(), 2000); const timeout = setTimeout(() => controller.abort(), 2000);
try { try {
const response = await fetch(`http://localhost:${port}/api/server-info/ping`, { const response = await fetch(`http://localhost:${port}/api/server-info/ping`, {