# Path: app.py
# def make_celery(app):
#         def __call__(self, *args, **kwargs):
# def create_app():
# def create_test_app():
#     class ContextTask(TaskBase):


import functools
from celery.signals import worker_shutdown
from app import cache

def single_instance_task():
    def task_exc(func):
        @functools.wraps(func)
        def wrapper(*args, **kwargs):
            lock_id = "celery-single-instance-" + func.__name__

# Path: app.py
# def make_celery(app):
#         def __call__(self, *args, **kwargs):
# def create_app():
# def create_test_app():
#     class ContextTask(TaskBase):


# Path: core/tasks.py
import functools
from celery.signals import worker_shutdown
from app import cache


def single_instance_task():
    def task_exc(func):
        @functools.wraps(func)
        def wrapper(*args, **kwargs):
            lock_id = "celery-single-instance-" + func.__name__

            check_lock = lambda: cache.get(lock_id)