diff --git a/tubesync/sync/management/commands/reset-tasks.py b/tubesync/sync/management/commands/reset-tasks.py index ae38a464..dc0029db 100644 --- a/tubesync/sync/management/commands/reset-tasks.py +++ b/tubesync/sync/management/commands/reset-tasks.py @@ -2,6 +2,8 @@ from django.core.management.base import BaseCommand, CommandError # noqa from django.db.transaction import atomic from django.utils.translation import gettext_lazy as _ from background_task.models import Task +from django_huey import DJANGO_HUEY +from common.huey import h_q_reset_tasks from common.logger import log from sync.models import Source from sync.tasks import index_source_task, check_source_directory_exists @@ -13,6 +15,8 @@ class Command(BaseCommand): def handle(self, *args, **options): log.info('Resettings all tasks...') + for queue_name in (DJANGO_HUEY or {}).get('queues', {}): + h_q_reset_tasks(queue_name) with atomic(durable=True): # Delete all tasks Task.objects.all().delete()