Skip to content

Commit

Permalink
Fix docstrings about heartbeat status on warnings (200, not 5XX) (#110)
Browse files Browse the repository at this point in the history
All implementations of heartbeat now return a 500 response only for errors or
worse. Docstrings needs to be updated.
  • Loading branch information
wilbrdt committed Apr 15, 2024
1 parent 9014f6e commit f3ff9c3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/dockerflow/django/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def heartbeat(request):
Runs all the Django checks and returns a JsonResponse with either
a status code of 200 or 500 depending on the results of the checks.
Any check that returns a warning or worse (error, critical) will
return a 500 response.
Any check that returns an error or worse (critical) will return
a 500 response.
"""
checks_to_run = (
(check.__name__, lambda: check(app_configs=None))
Expand Down
4 changes: 2 additions & 2 deletions src/dockerflow/flask/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,8 @@ def _heartbeat_view(self):
Runs all the registered checks and returns a JSON response with either
a status code of 200 or 500 depending on the results of the checks.
Any check that returns a warning or worse (error, critical) will
return a 500 response.
Any check that returns an error or worse (critical) will return
a 500 response.
"""
FAILED_STATUS_CODE = int(
flask.current_app.config.get(
Expand Down
4 changes: 2 additions & 2 deletions src/dockerflow/sanic/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ async def _heartbeat_view(self, request):
Runs all the registered checks and returns a JSON response with either
a status code of 200 or 500 depending on the results of the checks.
Any check that returns a warning or worse (error, critical) will
return a 500 response.
Any check that returns an error or worse (critical) will return
a 500 response.
"""
FAILED_STATUS_CODE = int(
request.app.config.get("DOCKERFLOW_HEARTBEAT_FAILED_STATUS_CODE", "500")
Expand Down

0 comments on commit f3ff9c3

Please sign in to comment.