Skip to content

feat: add Celery worker health check endpoint#456

Open
Vera3289 wants to merge 1 commit intoSoroScan:mainfrom
Vera3289:feat/412-celery-worker-health
Open

feat: add Celery worker health check endpoint#456
Vera3289 wants to merge 1 commit intoSoroScan:mainfrom
Vera3289:feat/412-celery-worker-health

Conversation

@Vera3289
Copy link
Copy Markdown
Contributor

Summary

Closes #412

Changes

  • GET /api/health/workers/ — calls celery.control.inspect(timeout=5).ping()
  • Returns 200 {status: ok, workers: [...]} when at least one worker responds
  • Returns 503 {status: no_workers} when ping returns empty
  • Returns 503 {status: error} when broker is unreachable (graceful timeout)
  • Tests cover all three cases via monkeypatching in test_health.py

Files changed

  • django-backend/soroscan/health.py
  • django-backend/soroscan/urls.py
  • django-backend/soroscan/ingest/tests/test_health.py

- GET /api/health/workers/ uses celery.control.inspect().ping() with 5s timeout
- Returns 200 {status: ok, workers: [...]} when at least one worker responds
- Returns 503 {status: no_workers} when ping returns empty
- Returns 503 {status: error} when broker is unreachable
- Tests cover all three cases via monkeypatching
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented Apr 29, 2026

@Vera3289 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Add health check endpoint specifically for Celery worker status

1 participant