【发布时间】:2016-03-22 15:51:46
【问题描述】:
如何检查celery执行的函数?
def notification():
# in_celery() returns True if called from celery_test(),
# False if called from not_celery_test()
if in_celery():
# Send mail directly without creation of additional celery subtask
...
else:
# Send mail with creation of celery task
...
@celery.task()
def celery_test():
notification()
def not_celery_test():
notification()
【问题讨论】:
标签: python flask celery celery-task