Celery, Django.. making a Task / thread launch sub-task / threads?
-
27-09-2019 - |
Question
I'm using celery with django and am trying to get a Task, like the one below:
class task1 (Task)
def run (self):
launch_some_other_task.delay()
But it doesn't seem to be working, I can go into more detail as far as my code but figured I would just ask first if this sort of thing will work as doesn't seem to be working for me. I am finding this necessary as I am using selenium, a web testing framework, where sometimes it will just hang where I can't get any output from this so I want to be able to kill if off if a certain condition isn't met (updating a memcache variable with a certain value within a specified number of seconds).
Thanks for any advice on this
Solution
Make sure you've added the following to your urls.py
:
import djcelery
djcelery.setup_loader()
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow