https://github.com/yezz123/dj-queue-health
Django app for checking queue health. Targeted to be used for Kubernetes deployments to periodically schedule
https://github.com/yezz123/dj-queue-health
celery django kubernetes queue redis rq timestamp
Last synced: 6 months ago
JSON representation
Django app for checking queue health. Targeted to be used for Kubernetes deployments to periodically schedule
- Host: GitHub
- URL: https://github.com/yezz123/dj-queue-health
- Owner: yezz123
- Created: 2022-05-11T18:59:26.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-10-28T15:05:42.000Z (12 months ago)
- Last Synced: 2025-03-25T04:32:35.563Z (7 months ago)
- Topics: celery, django, kubernetes, queue, redis, rq, timestamp
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# dj-queue-health - [](https://www.djangoproject.com/)
Simple django app for checking queue health. Targeted to be used for Kubernetes deployments to periodically schedule `update_queue_timestamp` and set timestamp and verified by `test_queue_health` as a probe to verify if worker works and is not stacked.
## Installation
- Using pip:
```bash
pip install dj-queue-health
```## Usage
- Add `dj_queue_health` to your INSTALLED_APPS setting like this:
```python
INSTALLED_APPS = [
...,
"dj_queue_health",
]
```- Add variable `django_queue_health` to your settings like this:
```python
# Minutes django_queue_health to check if there is queue log and if queue is running
django_queue_health = 10
```- Configure default [django cache](https://docs.djangoproject.com/en/4.0/topics/cache/).
- Queue Health use [django rq](https://github.com/rq/django-rq) or [celery](https://docs.celeryproject.org/en/stable/django/first-steps-with-django.html).
- Use commands:```bash
# Push job to queue that updates the timestamp
python manage.py update_queue_timestamp
# Check if timestamp in cache less than django_queue_health
python manage.py test_queue_health
```