Skip to content

Instantly share code, notes, and snippets.

View yousufctec's full-sized avatar

Mohamed K Yousuf yousufctec

  • Nanyang Technological University
  • Singapore
View GitHub Profile
@kgantsov
kgantsov / revoke_celery_tasks.py
Created January 2, 2019 11:22
Helper functions that revokes celery tasks by name and ID
from celery.task.control import revoke
from celery.task.control import inspect
def revoke_tasks_by_name(task_name, worker_prefix=''):
"""
Revoke all tasks by the name of the celery task
:param task_name: Name of the celery task
:param worker_prefix: Prefix for the worker