Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
832 views
in Technique[技术] by (71.8m points)

Celery/Django: shared_task tasks disappeared or not registering from task registry when starting a worker

When booting up a worker, it lists all of the registered shared_tasks that can be consumed by the worker.

When adding "proper" code to one of the shared_tasks (rather than test code) all of sudden the tasks were not registering.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Found this was because I was importing a constants file thusly:

from . import constants

and the constants file was actually in the folder above the tasks file. There was no debug error at all, so putting here just in case someone has the same problem


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...