Is there any “clean” way to kill workflows after the queue they listened to becomes empty?
The idea is that I do not need workers to continuously listen to the line if they have no work. I tried the autoscale option, but from my experience, even if I set the lower threshold to 0, the worker will not die.
In my case, I need to download 1000 files from somewhere using celery. So I put 1000 tasks in the queue, but that’s all I want this group of workers to do. It would be ideal if they could somehow die after everyone has finished downloading all the files, and not being idle there until I forget to kill the processes manually.
I could not find any suggestions on how to do this from inside the celery. Any ideas? Thank!
Clara source
share