我正在尝试task2
从task_success
信号连接
from celery.signals import task_success
from celery import Celery
app = Celery()
@app.task
def task1():
return 't1'
@app.task
def task2():
return 't2'
task_success.connect(task2, sender=task1)
当我运行此代码时,它会抛出
TypeError: cannot create weak reference to 'PromiseProxy' object
如果删除app.task
task2 的装饰器,它会完美运行。但是为什么无法连接到 celery 任务呢?