Answer the question
In order to leave comments, you need to log in
Celery and django. How to make tasks "synchronous"?
There is a jang website that needs to parse the price, I did it on celery, created two tasks, one for parsing the price itself (relatively fast) and the second for downloading pictures (long, because the pictures are in a large archive). Is it now possible to do without special crutches so that tasks of the same type are performed in turn, i.e. if you uploaded 2 price lists, did he parse the first one first, and then the second one?
I start the task from the save method of the model that stores the tasks.parseXml.delay(path_to_file) file, maybe not the best way, but it works :)
Answer the question
In order to leave comments, you need to log in
Is it now possible to do without special crutches so that tasks of the same type are performed in turn, i.e. if you uploaded 2 price lists, did he parse the first one first, and then the second one?
@celery_app.task(
queue="price_queue"
)
def do_parsing():
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question