简体   繁体   中英

How to execute celery task after another already executing task in python?

I need to execute secobd celery task after the first one is ready. The first task is already running and I have its id. How can I link another one to it?

# first task
first_task = change_timezone_geodata_task.delay(node.id, timezone, geodata_id)
task_id=  first_task .id
new task = change_timezone_geodata_task.delay(node2.id, timezone2, geodata_id2)

How to make new task execute after task?

The first thing that comes to mind as solution to your problem is to rely on Celery's task linking capability.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM