芹菜链没有触发第二任务
我有两个芹菜任务,应严格运行。
def celery_run_tasks():
chain(task_one.s(arg1, arg2), task_two.s(arg1, arg2)).apply_async()
因此,第一个任务进行2参数
,最后将一些数据填充到PostgreSQL表中。 第二个任务应启动之后,从第一个表
中获取数据,生成新计算,然后将其发布到第二个
postgresql表。
我在代码中看到的问题是,它将所有数据填充到第一个表格,但第二个是空的。我尝试了和弦和小组的不同变化,但它仍然不起作用。
让我知道您的想法,请具体说明。谢谢。
PS我确实检查了芹菜文档!,请不要仅仅发布链接。
I have two celery Tasks which should be run in strict order.
def celery_run_tasks():
chain(task_one.s(arg1, arg2), task_two.s(arg1, arg2)).apply_async()
So, first task taking 2 Arguments
and in the end Populating some data to PostgreSQL table.
After that second task should Start, get data from FIRST table
, generate new calculations and post them to SECOND
PostgreSQL table.
The problem what I see with my code that its populating all data to first table, but second one is empty. I tried different variations with Chord and Groups and its still does not work.
Let me know what you think and Please be specific. Thank you.
P.S. I did check Celery documentation!, please don't just post link to it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
因此问题是,第一个任务是将其结果发送到第二个任务作为第一个参数。因此,我的第二任任务收到3个参数,而不是两个参数并给出错误。
为了避免将第二个任务作为
si
,这意味着不接受以前任务的任何参数,它将有效:So issue was that first task was sending result of it to second task as first argument. So my second task receive 3 arguments instead of two and give error.
To avoid it make second task as
si
which mean not accept any arguments from previous tasks and it will work: