Skip to content

Add real app health check - #65

Merged
akargi merged 1 commit into
mainfrom
feature/app-health-check
Sep 16, 2026
Merged

akargi merged 1 commit into
mainfrom
feature/app-health-check

Conversation

@akargi

@akargi akargi commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds a real application-level health check that validates critical dependencies instead of returning a static placeholder response. It checks database connectivity and Redis availability and exposes the result through the main /api/health endpoint.

Related Issues

N/A

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes existing behaviour)
  • Documentation only
  • Refactor / chore (no functional change)

Changes

  • Added a real health check in app.service.ts that:
    • runs SELECT 1 against the TypeORM data source
    • pings Redis via the shared REDIS_CLIENT
    • returns ok when both dependencies are healthy, otherwise degraded
  • Updated the root app controller in app.controller.ts to serve the asynchronous health response at /api/health
  • Added regression tests in app.service.spec.ts covering:
    • healthy dependency state
    • degraded dependency state

Checklist

  • I have read the CONTRIBUTING guide.
  • npm run lint passes.
  • npx tsc --noEmit passes (no type errors).
  • npm run build succeeds.
  • npm test passes, and I added/updated tests for my change where it
    made sense.
  • Any Stellar/Soroban network access goes through the stellar module
    services (no direct Horizon/RPC calls from feature modules).
  • I did not commit secrets, private keys, or mainnet credentials.

Notes for Reviewers

This is a lightweight app health endpoint intended for load balancers or uptime checks. It is intentionally dependency-aware and returns per-service status for DB and Redis. It does not yet include more advanced checks for queue workers or external providers.

@akargi
akargi merged commit 2e8b2c5 into main Sep 16, 2026
1 check passed
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