0

A celery worker created with one file of tasks "remembers" tasks from a previous celery worker which are not in the file of tasks that I am now using.

At a time in the past, I created a celery worker using a file containing tasks called 'tasks.py.'

  celery -A tasks worker --loglevel=info

All was well. Now, having moved on, I am attempting to create a celery worker from a different file of tasks called 'dwtasks.py.'

  celery -A dwtasks worker --loglevel=info

The splash screen that comes up when the new worker starts lists the tasks defined in 'dwtasks.py' and all the tasks that were defined in 'tasks.py.' It will also fail to create the worker if 'tasks.py' is not available. If I make no reference to 'tasks.py,' how is it possible for all future celery workers to know about those tasks?

Celery is v4.3.0 (rhubarb) OS is Ubuntu 16.04

dalex1
  • 49
  • 4
  • The only thing that can cause this that I can think of is the auto-discovery in Celery config and/or celery imports configuration... Please attach your Celery config if you may. – DejanLekic Jul 12 '19 at 15:21
  • I am sorry. I now believe that the problem is my celeryconfig. Thank you. – dalex1 Jul 12 '19 at 15:38

1 Answers1

0

You most likely misconfigured Celery. Check your configuration and see whether you use auto-discovery, and where your celery imports are...

DejanLekic
  • 18,787
  • 4
  • 46
  • 77