Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Celery health check endpoint #1536

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

sudan45
Copy link
Contributor

@sudan45 sudan45 commented Oct 16, 2024

Addresses

Feature:

  • Introduced a health check endpoint (HealthCheckView) that allows clients to verify the status of the Celery worker.
  • The endpoint responds with a "healthy" status when the worker is active and responsive, and "unhealthy" if not.

This PR doesn't introduce any:

  • temporary files, auto-generated files or secret keys
  • n+1 queries
  • flake8 issues
  • print
  • typos
  • unwanted comments

This PR contains valid:

  • tests
  • permission checks (tests here too)
  • translations

@thenav56
Copy link
Member

Let's explore this https://github.com/revsys/django-health-check
It already has ping function https://github.com/revsys/django-health-check/blob/master/health_check/contrib/celery_ping/backends.py

Copy link
Member

@susilnem susilnem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor change

deep/urls.py Outdated Show resolved Hide resolved
@sudan45 sudan45 force-pushed the feature/celery-heath-check branch 2 times, most recently from 37b8606 to f9f8ccf Compare November 22, 2024 10:03
Copy link

codecov bot commented Nov 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.74%. Comparing base (4d7ee5d) to head (c4605f7).
Report is 11 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1536      +/-   ##
===========================================
+ Coverage    79.63%   79.74%   +0.11%     
===========================================
  Files          464      464              
  Lines        30076    30136      +60     
  Branches      3379     3384       +5     
===========================================
+ Hits         23952    24033      +81     
+ Misses        6124     6103      -21     
Flag Coverage Δ
?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

Copy link
Member

@susilnem susilnem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sudan45 sudan45 changed the title Add Celery health check endpoint and corresponding unit tests Add Celery health check endpoint \ Nov 22, 2024
@sudan45 sudan45 changed the title Add Celery health check endpoint \ Add Celery health check endpoint Nov 22, 2024
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.

5 participants