[Fixed]-Django-Execute function after Celery job completion

1👍

The easy way would be to do

while not asyncresult.ready():
    time.sleep(1)

# Now the file is downloaded

And if you want it a bit nicer you can use callbacks where the link is a task that is to be performed when the regular task is done.

download_file.apply_async(path, link=write_to_db.subtask(path))
👤olofom

Leave a comment