From 4af101cb4ce531645116df34e28de4817a5d9c30 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Wed, 25 May 2022 15:15:33 +0200 Subject: [PATCH] skip server_domain check on single server portals --- packages/health-check/bin/cli | 2 +- packages/health-check/src/checks/critical.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/health-check/bin/cli b/packages/health-check/bin/cli index 21b6b9f7..c6753b57 100755 --- a/packages/health-check/bin/cli +++ b/packages/health-check/bin/cli @@ -71,7 +71,7 @@ require("yargs/yargs")(process.argv.slice(2)) const entry = { date: new Date().toISOString(), - checks: (await Promise.all(checks.map((check) => new Promise(check)))).map(middleware), + checks: (await Promise.all(checks.map((check) => new Promise(check)))).filter(Boolean).map(middleware), }; db.read() // read before writing to make sure no external changes are overwritten diff --git a/packages/health-check/src/checks/critical.js b/packages/health-check/src/checks/critical.js index 127ebd8a..28992b28 100644 --- a/packages/health-check/src/checks/critical.js +++ b/packages/health-check/src/checks/critical.js @@ -122,8 +122,9 @@ async function registryWriteAndReadCheck(done) { // directServerApiAccessCheck returns the basic server api check on direct server address async function directServerApiAccessCheck(done) { - if (!process.env.SERVER_DOMAIN) { - return done({ up: false, errors: [{ message: "SERVER_DOMAIN env variable not configured" }] }); + // skip if SERVER_DOMAIN is not set or it equals PORTAL_DOMAIN (single server portals) + if (!process.env.SERVER_DOMAIN || process.env.SERVER_DOMAIN === process.env.PORTAL_DOMAIN) { + return done(); } const [portalAccessCheck, serverAccessCheck] = await Promise.all([