Skip to content

Commit

Permalink
feat: Add separate liveness and readiness checks (#5151)
Browse files Browse the repository at this point in the history
  • Loading branch information
rolodato authored Feb 21, 2025
1 parent f7487ac commit 27a69a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions api/app/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
re_path(r"^api/v1/", include("api.urls.v1", namespace="api-v1")),
re_path(r"^api/v2/", include("api.urls.v2", namespace="api-v2")),
re_path(r"^admin/", admin.site.urls),
re_path(r"^health/liveness/?", views.version_info),
re_path(r"^health/readiness/?", include("health_check.urls")),
re_path(r"^health", include("health_check.urls", namespace="health")),
# Aptible health checks must be on /healthcheck and cannot redirect
# see https://www.aptible.com/docs/core-concepts/apps/connecting-to-apps/app-endpoints/https-endpoints/health-checks
Expand Down
2 changes: 1 addition & 1 deletion api/scripts/healthcheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import requests

url = "http://localhost:8000/health"
url = "http://localhost:8000/health/liveness"
status = requests.get(url).status_code

sys.exit(0 if 200 >= status < 300 else 1)

0 comments on commit 27a69a9

Please sign in to comment.