Skip to content
Snippets Groups Projects
Commit 952dd84c authored by richard.petersen's avatar richard.petersen :sailboat:
Browse files

Fix: Readiness probe fails when cache is warmed

Root cause: Every readiness check triggered a cache warming
Solution: Move readiness to startup probe
parent 6ec9b1ce
No related branches found
No related tags found
No related merge requests found
...@@ -35,7 +35,7 @@ export function createApp () { ...@@ -35,7 +35,7 @@ export function createApp () {
const httpLogger = pinoHttp({ logger, autoLogging: { ignorePaths } }) const httpLogger = pinoHttp({ logger, autoLogging: { ignorePaths } })
const healthCheck = new health.HealthChecker() const healthCheck = new health.HealthChecker()
const readinessCheck = new health.ReadinessCheck('getDependencies', async function () { const startupCheck = new health.StartupCheck('warmup cache', async function () {
try { try {
const viteManifests = await loadViteManifests() const viteManifests = await loadViteManifests()
const deps = viteManifestToDeps(viteManifests) const deps = viteManifestToDeps(viteManifests)
...@@ -45,7 +45,7 @@ export function createApp () { ...@@ -45,7 +45,7 @@ export function createApp () {
throw e throw e
} }
}) })
healthCheck.registerReadinessCheck(readinessCheck) healthCheck.registerStartupCheck(startupCheck)
// Application-level middleware // Application-level middleware
app.use(httpLogger) app.use(httpLogger)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment