I want to run two copies of celery on the same machine. One for version "A" of my application, the other for version "B".
I have two instances that I start as follows:
(env1)/home/me/firstapp$ celery -A app.tasks worker --config celeryconfig
(env2)/home/me/secondapp$ celery -A app.tasks worker -n Carrot --config celeryconfig
In tasks.py in each application, I create an instance of celery, like this:
celery = Celery('tasks', backend='amqp', broker='amqp://guest@127.0.0..1.5672//')
@celery.task
def run_a_task():
do_stuff()
In env2 task.py, how can I indicate that I want to use the second instance of celery from secondapp (named Carrot), and not the first from firstapp? I suspect that I need to change something in the constructor for celery on the first line, but I do not know what to add.
source
share