def enqueue_task(signature):
    try:
        if signature not in queue():
            queue().append(signature)
    except (RuntimeError):
        signature()
If working in a request context, push task signature to ``g`` to run
dataset/ETHPy150Open CenterForOpenScience/osf.io/framework/celery_tasks/handlers.py/enqueue_task