wait for health

This commit is contained in:
resonic-user 2025-06-20 01:44:05 +02:00
parent 8350fe4b08
commit 3b4a48932b
3 changed files with 12 additions and 1 deletions

View File

@ -282,7 +282,7 @@ jobs:
# Verwende die URIs aus .env
wait_for "webapp" "$CLIENT_URI"
wait_for "backend" "$GRAPHQL_URI"
wait_for "backend" "$BACKEND_HEALTH"
wait_for "mailserver" "http://localhost:1080"
wait_for "minio" "http://localhost:9000/minio/health/live"

View File

@ -5,6 +5,7 @@ NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=letmein
GRAPHQL_URI=http://localhost:4000
CLIENT_URI=http://localhost:3000
BACKEND_HEALTH=http://localhost:4000/api/health
# E-Mail default settings
SUPPORT_EMAIL="devops@ocelot.social"

View File

@ -84,6 +84,16 @@ const createServer = (options?) => {
const app = express()
// new health check
app.get('/api/health', async (req, res) => {
try {
await serverDatabase.driver.verifyConnectivity()
res.status(200).send({ status: 'ok' })
} catch (err) {
res.status(500).send({ status: 'unhealthy', error: err.message })
}
})
// TODO: this exception is required for the graphql playground, since the playground loads external resources
// See: https://github.com/graphql/graphql-playground/issues/1283
app.use(