Accept queue name strings as well

This commit is contained in:
tcely 2025-06-15 11:29:12 -04:00 committed by GitHub
parent 97ef9e2f27
commit 98f5d45391
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -26,6 +26,9 @@ def h_q_tuple(q, /):
def h_q_reset_tasks(q, /, *, maint_func=None):
if isinstance(q, str):
from django_huey import get_queue
q = get_queue(q)
# revoke to prevent pending tasks from executing
for t in q._registry._registry:
q.revoke_all(t, revoke_until=delay_to_eta(600))