Skip to content

Check the database in a readiness endpoint - #16

Merged
jacalapa merged 1 commit into
mainfrom
health-ready
Oct 12, 2026
Merged

jacalapa merged 1 commit into
mainfrom
health-ready

Conversation

@jacalapa

Copy link
Copy Markdown
Contributor

What

  • GET /health/ready opens a connection to PostgreSQL and answers 503 when it can't. It's for a readiness probe, so an orchestrator stops sending traffic to an instance that has lost its database.
  • GET /health stays a liveness check and doesn't touch the database.
  • Without a connection string (translations in memory) the readiness check has nothing to check and answers 200.
  • README: both endpoints.

Tests

  • New: ready is healthy with the database up; after the database is dropped, ready answers 503 while /health stays 200.
  • 117/117 locally.

/health stays a liveness check. /health/ready also opens a connection to
PostgreSQL and answers 503 when it cannot, so an orchestrator stops
sending traffic to an instance that has lost its database.
@jacalapa
jacalapa merged commit fac00f9 into main Oct 12, 2026
2 checks passed
@jacalapa
jacalapa deleted the health-ready branch October 12, 2026 20:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant