Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
476 views
in Technique[技术] by (71.8m points)

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 ?

question from:https://stackoverflow.com/questions/66060848/how-to-execute-celery-task-after-another-already-executing-task-in-python

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...