Celery Received unregistered task of type (run example)

后端 未结 30 1868
旧时难觅i
旧时难觅i 2020-11-28 04:42

I\'m trying to run example from Celery documentation.

I run: celeryd --loglevel=INFO

/usr/local/lib/python2.7/dist-packages/celery/loade         


        
30条回答
  •  猫巷女王i
    2020-11-28 05:23

    Whether you use CELERY_IMPORTS or autodiscover_tasks, the important point is the tasks are able to be found and the name of the tasks registered in Celery should match the names the workers try to fetch.

    When you launch the Celery, say celery worker -A project --loglevel=DEBUG, you should see the name of the tasks. For example, if I have a debug_task task in my celery.py.

    [tasks]
    . project.celery.debug_task
    . celery.backend_cleanup
    . celery.chain
    . celery.chord
    . celery.chord_unlock
    . celery.chunks
    . celery.group
    . celery.map
    . celery.starmap
    

    If you can't see your tasks in the list, please check your celery configuration imports the tasks correctly, either in --setting, --config, celeryconfig or config_from_object.

    If you are using celery beat, make sure the task name, task, you use in CELERYBEAT_SCHEDULE matches the name in the celery task list.

提交回复
热议问题