celery-canvas

Cloning a celery chain

送分小仙女□ 提交于 2020-01-14 04:46:12
问题 I have an interesting issue attempting to clone a celery chain for use in a group, my intended use case is something like group([chain.clone(args=args) for args in it]) however it keeps complaining about not having enough arguments. I have broken this down using the below in a file named tasks.py @app.task def add(x,y): return x+y and then from the python shell >>> from tasks import add >>> chain=add.s()|add.s(1) >>> chain magic_carpet.celery.add() | add(1) >>> chain.args () >>> chain.delay(2