Update healthcheck

This commit is contained in:
Alan Grainger
2024-11-04 11:15:00 +01:00
parent be66b16a08
commit 4b0253f211
5 changed files with 34 additions and 21 deletions
+6 -2
View File
@@ -69,8 +69,12 @@ app.get('/:type(photo|video)/:key/:id', async (req, res) => {
})
// Healthcheck
app.get('/healthcheck', (_req, res) => {
res.send('ok')
app.get('/healthcheck', async (_req, res) => {
if (await immich.accessible()) {
res.send('ok')
} else {
res.status(502).send()
}
})
// Send a 404 for all other routes