Im trying to allow users to schedule a periodic task. Im also running multiple celery workers in a container. My command for that container used to look like this:
celery worker -c 4 -B -l INFO -A my.celery.app.celery --scheduler my.celery.scheduler.SchedulerClass
but what happened was that the scheduled task ran 4 times when the time came to run the task.
so i read that you should have a dedicated worker for beat. I changed my command to this one:
celery worker -c 4 -l INFO -A my.celery.app.celery
and added another container exactly like that one that runs the command:
celery -l INFO -B -A my.celery.app.celery --scheduler my.celery.scheduler.SchedulerClass
hoping that now that there is only one beat, there will be no duplicate tasks. But I still get 4 tasks running instead of one.
Any ideas on how this should be done will be helpful