Python hangs when trying to access celery shared_task
I have a celery task in a django project that, when called, does absolutely nothing. No exception is thrown, Rabbit MQ and celery registers get the job as well.
@shared_task
def test():
print('starting task')
time.sleep(10)
return True
In an interactive shell, if I import a task and try to run it
>import twitterbot.tasks
>twitter_bot.tasks.test.delay()
The REPL just sits there until I send the keyboard interrupt. Then I get
^CTraceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/kombu/utils/objects.py", line 42, in __get__
return obj.__dict__[self.__name__]
KeyError: 'tasks'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/kombu/utils/objects.py", line 42, in __get__
return obj.__dict__[self.__name__]
KeyError: 'data'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/kombu/utils/objects.py", line 42, in __get__
return obj.__dict__[self.__name__]
KeyError: 'tasks'
During handling of the above exception, another exception occurred:
keyboard interrupt here ..
It's weird if I just try to access the property of the task
>twitter_bot.tasks.test
I have the same problem. Is this a problem with my import or what?
+3
source to share
No one has answered this question yet
Check out similar questions: