Reputation: 107
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.
Upvotes: 0
Views: 1041
Reputation: 107
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:
def celery_run_tasks():
chain(task_one(arg1, arg2), task_two.si(arg1, arg2)).apply_async()
Upvotes: 1