Skip to content

Instantly share code, notes, and snippets.

View ebram96's full-sized avatar
🎯
GettingThingsToLife

Ebram Shehata ebram96

🎯
GettingThingsToLife
View GitHub Profile
@ebram96
ebram96 / celery_helpyer.py
Created March 7, 2023 01:05
Checking whether a Celery task is already running
from celery import current_app
class CeleryHelper:
"""Contains helper functionalities to be used while interacting with Celery."""
@staticmethod
def is_being_executed(task_name: str) -> bool:
"""Returns whether the task with given task_name is already being executed.
Args: