defworker_main(self,argv=None):ifargv is None:argv=sys.argvif'worker'notinargv:raiseValueError("The worker sub-command must be specified in argv.\n""Use app.start() to programmatically start other commands.")self.start(argv=argv) 4.1 添加子command celery/bin/celery.py 会进行添加 子command...
# def test_worker_main(self):# from celery.bin import worker as worker_bin## class worker(worker_bin.worker):## def execute_from_commandline(self, argv):# return argv## prev, worker_bin.worker = worker_bin.worker, worker# try:# ret = self.app.worker_main(argv=['--version'])# ...
def worker_main(self, argv=None): if argv is None: argv = sys.argv if 'worker' not in argv: raise ValueError( "The worker sub-command must be specified in argv.\n" "Use app.start() to programmatically start other commands." ) self.start(argv=argv) 1. 2. 3. 4. 5. 6. 7. ...
'celery.worker.components:Timer', 'celery.worker.components:StateDB', 'celery.worker.components:Consumer', 'celery.worker.autoscale:WorkerComponent', } def __init__(self, app=None, hostname=None, **kwargs): self.blueprint = self.Blueprint( steps=self.app.steps['worker'], on_start=self....
celery_app.worker_main(args) File "/.../site-packages/celery/app/base.py", line 383, in worker_main raise ValueError( ValueError: The worker sub-command must be specified in argv. Use app.start() to programmatically start other commands. ...
Ability to show task details (arguments, start time, run-time, and more) Graphs and statistics Remote Control View worker status and statistics Shutdown and restart worker instances Control worker pool size and autoscale settings View and modify the queues a worker instance consumes from Vi...
airflow celery worker As the service is started and ready to receive tasks. As soon as a task is triggered in its direction, it will start its job. 当服务启动并准备好接收任务时。一旦任务在其方向上被触发,它就会开始工作。 For stopping the worker, use the following command given below. ...
qeed@(-a_r(g@k8jo8y3r27%m-DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1]depends_on:-redisredis:image:redis:alpinecelery:build:./projectcommand:celery -A core worker -l infovolumes:-./project/:/usr/src/app/environment:-DEBUG=1-SECRET_KEY=dbaa1_i7%*3r9-=z-+_mz4r-!qeed@(-a_...
app.start 打开一个新的终端,使用下面的命令启动celery的worker服务: $ python myapp.py worker -l DEBUG 正常情况下,可以看到worker正常启动。启动的时候会显示一些banner信息,包括AMQP的实现协议,任务等: $ celery -A myapp worker -l DEBUG --- celery@bogon v5.1.2 (sun-harmonics) --- *** ---...
But I try to start celery programmatically in a thread. maybe it is the cause. This is my thread: from __future__ import absolute_import, unicode_literals import threading from celery import current_app from celery.bin import worker app = current_app._get_current_object() class Celery...