From 952dd84c377a03a158b7f63863896f8488b5c4b7 Mon Sep 17 00:00:00 2001 From: Richard Petersen <richard.petersen@open-xchange.com> Date: Mon, 29 Nov 2021 16:37:57 +0100 Subject: [PATCH] Fix: Readiness probe fails when cache is warmed Root cause: Every readiness check triggered a cache warming Solution: Move readiness to startup probe --- src/createApp.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/createApp.js b/src/createApp.js index 53662a7..ded121f 100644 --- a/src/createApp.js +++ b/src/createApp.js @@ -35,7 +35,7 @@ export function createApp () { const httpLogger = pinoHttp({ logger, autoLogging: { ignorePaths } }) const healthCheck = new health.HealthChecker() - const readinessCheck = new health.ReadinessCheck('getDependencies', async function () { + const startupCheck = new health.StartupCheck('warmup cache', async function () { try { const viteManifests = await loadViteManifests() const deps = viteManifestToDeps(viteManifests) @@ -45,7 +45,7 @@ export function createApp () { throw e } }) - healthCheck.registerReadinessCheck(readinessCheck) + healthCheck.registerStartupCheck(startupCheck) // Application-level middleware app.use(httpLogger) -- GitLab