feat(core): Introduce DB health check (#10661)

This commit is contained in:
Iván Ovejero
2024-09-05 11:04:48 +02:00
committed by GitHub
parent 3a8078068e
commit a8e80d0c4b
6 changed files with 59 additions and 3 deletions

View File

@@ -172,6 +172,12 @@ export class Worker extends BaseCommand {
const server = http.createServer(app);
app.get('/healthz/readiness', async (_req, res) => {
return Db.connectionState.connected && Db.connectionState.migrated
? res.status(200).send({ status: 'ok' })
: res.status(503).send({ status: 'error' });
});
app.get(
'/healthz',