Run a chord callback even if the main tasks fail

前端 未结 2 747
时光说笑
时光说笑 2020-12-15 23:15

Is it possible to run a chord callback even if the main tasks failed?

I\'ve created a chord which I added a bunch of tasks and registered a callback to it. My proble

2条回答
  •  醉话见心
    2020-12-16 00:02

    You just have to change manner how link_error is called. Instead of string reference, pass signature with arguments you want.

    In example above, you can pass argument as following

    c = chord(
        [raise_exception.s(), good.s(), raise_exception.s()], 
        callback.s().set(link_error=[error_callback.s()])
    )
    

    Just keep on mind, first argument will be task_id and further arguments will be those defined in signature.

提交回复
热议问题