-
+
- Requeue All +
- Delete All +
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 06549c17..3d82144b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,7 +34,7 @@ jobs: run: | python -m pip install --upgrade pip pip install django==${{ matrix.django-version }} \ - redis django-redis pyyaml rq sentry-sdk rq-scheduler + redis django-redis pyyaml rq sentry-sdk - name: Run Test run: | diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f0583c4..5ede0e2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +### Version 3.0 (2024-10-28) +* Added support for RQ 2.0. Thanks @selwin! +* Many typing improvements. Thanks @SpecLad and @terencehonles! +* Added management command to suspend and resume workers. Thanks @jackkinsella! +* Better support for Redis Sentinel. Thanks @alaouimehdi1995! + ### Version 2.10.2 (2024-03-23) * Added support for Django 5.0. Thanks @selwin! * Fixed an error in Python 3.12. Thanks @selwin! diff --git a/django_rq/management/commands/rqworker.py b/django_rq/management/commands/rqworker.py index 7df14183..c973af55 100644 --- a/django_rq/management/commands/rqworker.py +++ b/django_rq/management/commands/rqworker.py @@ -2,7 +2,6 @@ import sys from redis.exceptions import ConnectionError -from rq import Connection from rq.logutils import setup_loghandlers from django.core.management.base import BaseCommand @@ -84,21 +83,18 @@ def handle(self, *args, **options): 'queue_class': options['queue_class'], 'job_class': options['job_class'], 'name': options['name'], - 'default_worker_ttl': options['worker_ttl'], + 'worker_ttl': options['worker_ttl'], 'serializer': options['serializer'] } w = get_worker(*args, **worker_kwargs) - # Call Connection context manager to push the redis connection into LocalStack - # without this, jobs using RQ's get_current_job() will fail - with Connection(w.connection): - # Close any opened DB connection before any fork - reset_db_connections() + # Close any opened DB connection before any fork + reset_db_connections() - w.work( - burst=options.get('burst', False), with_scheduler=options.get('with_scheduler', False), - logging_level=level, max_jobs=options['max_jobs'] - ) + w.work( + burst=options.get('burst', False), with_scheduler=options.get('with_scheduler', False), + logging_level=level, max_jobs=options['max_jobs'] + ) except ConnectionError as e: self.stderr.write(str(e)) sys.exit(1) diff --git a/django_rq/templates/django_rq/failed_jobs.html b/django_rq/templates/django_rq/failed_jobs.html new file mode 100644 index 00000000..f669df68 --- /dev/null +++ b/django_rq/templates/django_rq/failed_jobs.html @@ -0,0 +1,170 @@ +{% extends "admin/base_site.html" %} + +{% load static jquery_path django_rq %} + +{% block title %}Failed Jobs in {{ queue.name }} {{ block.super }}{% endblock %} + +{% block extrastyle %} + {{ block.super }} + +{% endblock %} + +{% block extrahead %} + {{ block.super }} + + + + +{% endblock %} + + +{% block breadcrumbs %} +
+{% endblock %} + +{% block content_title %}