瀏覽代碼

Reorganize command-line arguments to match class arguments.

--send-events -> --task-events
--schedule -> --schedule-filename
--maxtasksperchid -> --max-tasks-per-child

--maxmemperchild -> --max-memory-per-child (new in 4.0)

Beat(scheduler_cls=) -> Beat(scheduler=)

Worker(send_events=) -> Worker(task_events=)
Worker(task_time_limit=) -> Worker(time_limit=)
Worker(task_soft_time_limit=) -> Worker(task_soft_time_limit=)
Worker(state_db=) -> Worker(statedb=)

Beat(working_directory=) -> Beat(workdir=)
Ask Solem 8 年之前
父節點
當前提交
bbe3b1d99b

+ 5 - 2
celery/apps/beat.py

@@ -43,14 +43,17 @@ class Beat(object):
     def __init__(self, max_interval=None, app=None,
                  socket_timeout=30, pidfile=None, no_color=None,
                  loglevel='WARN', logfile=None, schedule=None,
-                 scheduler_cls=None, redirect_stdouts=None,
+                 scheduler=None,
+                 scheduler_cls=None,  # XXX use scheduler
+                 redirect_stdouts=None,
                  redirect_stdouts_level=None, **kwargs):
         self.app = app = app or self.app
         either = self.app.either
         self.loglevel = loglevel
         self.logfile = logfile
         self.schedule = either('beat_schedule_filename', schedule)
-        self.scheduler_cls = either('beat_scheduler', scheduler_cls)
+        self.scheduler_cls = either(
+            'beat_scheduler', scheduler, scheduler_cls)
         self.redirect_stdouts = either(
             'worker_redirect_stdouts', redirect_stdouts)
         self.redirect_stdouts_level = either(

+ 3 - 2
celery/apps/worker.py

@@ -75,6 +75,7 @@ BANNER = """\
 .> transport:   {conninfo}
 .> results:     {results}
 .> concurrency: {concurrency}
+.> task events: {events}
 
 [queues]
 {queues}
@@ -194,8 +195,8 @@ class Worker(WorkController):
             pool = pool.__module__
         concurrency += ' ({0})'.format(pool.split('.')[-1])
         events = 'ON'
-        if not self.send_events:
-            events = 'OFF (enable -E to monitor this worker)'
+        if not self.task_events:
+            events = 'OFF (enable -E to monitor tasks in this worker)'
 
         banner = BANNER.format(
             app=appr,

+ 2 - 2
celery/bin/base.py

@@ -138,7 +138,7 @@ class Command(object):
         Option('-b', '--broker', default=None),
         Option('--loader', default=None),
         Option('--config', default=None),
-        Option('--workdir', default=None, dest='working_directory'),
+        Option('--workdir', default=None),
         Option('--no-color', '-C', action='store_true', default=None),
         Option('--quiet', '-q', action='store_true'),
     )
@@ -382,7 +382,7 @@ class Command(object):
             self.no_color = preload_options['no_color']
         except KeyError:
             pass
-        workdir = preload_options.get('working_directory')
+        workdir = preload_options.get('workdir')
         if workdir:
             os.chdir(workdir)
         app = (preload_options.get('app') or

+ 2 - 3
celery/bin/beat.py

@@ -93,10 +93,9 @@ class beat(Command):
     supports_args = False
 
     def run(self, detach=False, logfile=None, pidfile=None, uid=None,
-            gid=None, umask=None, working_directory=None, **kwargs):
+            gid=None, umask=None, workdir=None, **kwargs):
         if not detach:
             maybe_drop_privileges(uid=uid, gid=gid)
-        workdir = working_directory
         kwargs.pop('app', None)
         beat = partial(self.app.Beat,
                        logfile=logfile, pidfile=pidfile, **kwargs)
@@ -112,7 +111,7 @@ class beat(Command):
         parser.add_option('--detach', action='store_true')
         parser.add_option('-s', '--schedule', default=c.beat_schedule_filename)
         parser.add_option('--max-interval', type='float')
-        parser.add_option('-S', '--scheduler', dest='scheduler_cls')
+        parser.add_option('-S', '--scheduler')
         parser.add_option('-l', '--loglevel', default='WARN')
         daemon_options(parser, default_pidfile='celerybeat.pid')
         parser.add_options(self.app.user_options['beat'])

+ 8 - 11
celery/bin/celery.py

@@ -826,14 +826,11 @@ class shell(Command):  # pragma: no cover
 
     option_list = Command.option_list + (
         Option('--ipython', '-I',
-               action='store_true', dest='force_ipython',
-               help='force iPython.'),
+               action='store_true', help='force iPython.'),
         Option('--bpython', '-B',
-               action='store_true', dest='force_bpython',
-               help='force bpython.'),
+               action='store_true', help='force bpython.'),
         Option('--python', '-P',
-               action='store_true', dest='force_python',
-               help='force default Python shell.'),
+               action='store_true', help='force default Python shell.'),
         Option('--without-tasks', '-T', action='store_true',
                help="don't add tasks to locals."),
         Option('--eventlet', action='store_true',
@@ -841,8 +838,8 @@ class shell(Command):  # pragma: no cover
         Option('--gevent', action='store_true', help='use gevent.'),
     )
 
-    def run(self, force_ipython=False, force_bpython=False,
-            force_python=False, without_tasks=False, eventlet=False,
+    def run(self, ipython=False, bpython=False,
+            python=False, without_tasks=False, eventlet=False,
             gevent=False, **kwargs):
         sys.path.insert(0, os.getcwd())
         if eventlet:
@@ -872,11 +869,11 @@ class shell(Command):  # pragma: no cover
                 if not task.name.startswith('celery.')
             })
 
-        if force_python:
+        if python:
             return self.invoke_fallback_shell()
-        elif force_bpython:
+        elif bpython:
             return self.invoke_bpython_shell()
-        elif force_ipython:
+        elif ipython:
             return self.invoke_ipython_shell()
         return self.invoke_default_shell()
 

+ 4 - 4
celery/bin/celeryd_detach.py

@@ -27,13 +27,13 @@ C_FAKEFORK = os.environ.get('C_FAKEFORK')
 
 
 def detach(path, argv, logfile=None, pidfile=None, uid=None,
-           gid=None, umask=None, working_directory=None, fake=False, app=None,
+           gid=None, umask=None, workdir=None, fake=False, app=None,
            executable=None, hostname=None):
     hostname = default_nodename(hostname)
     logfile = node_format(logfile, hostname)
     pidfile = node_format(pidfile, hostname)
     fake = 1 if C_FAKEFORK else fake
-    with detached(logfile, pidfile, uid, gid, umask, working_directory, fake,
+    with detached(logfile, pidfile, uid, gid, umask, workdir, fake,
                   after_forkers=False):
         try:
             if executable is not None:
@@ -160,11 +160,11 @@ class detached_celeryd(object):
 
     def prepare_arguments(self, parser):
         daemon_options(parser, default_pidfile='celeryd.pid')
-        parser.add_option('--workdir', default=None, dest='working_directory')
+        parser.add_option('--workdir', default=None)
         parser.add_option('-n', '--hostname')
         parser.add_option(
             '--fake',
-            default=False, action='store_true', dest='fake',
+            default=False, action='store_true',
             help="Don't fork (for debugging purposes)",
         )
 

+ 3 - 4
celery/bin/events.py

@@ -104,7 +104,7 @@ class events(Command):
     def run(self, dump=False, camera=None, frequency=1.0, maxrate=None,
             loglevel='INFO', logfile=None, prog_name='celery events',
             pidfile=None, uid=None, gid=None, umask=None,
-            working_directory=None, detach=False, **kwargs):
+            workdir=None, detach=False, **kwargs):
         self.prog_name = prog_name
 
         if dump:
@@ -114,7 +114,7 @@ class events(Command):
                                   loglevel=loglevel, logfile=logfile,
                                   pidfile=pidfile, uid=uid, gid=gid,
                                   umask=umask,
-                                  working_directory=working_directory,
+                                  workdir=workdir,
                                   detach=detach)
         return self.run_evtop()
 
@@ -129,10 +129,9 @@ class events(Command):
         return evtop(app=self.app)
 
     def run_evcam(self, camera, logfile=None, pidfile=None, uid=None,
-                  gid=None, umask=None, working_directory=None,
+                  gid=None, umask=None, workdir=None,
                   detach=False, **kwargs):
         from celery.events.snapshot import evcam
-        workdir = working_directory
         self.set_process_status('cam')
         kwargs['app'] = self.app
         cam = partial(evcam, camera,

+ 18 - 24
celery/bin/worker.py

@@ -71,7 +71,7 @@ The :program:`celery worker` command (previously known as ``celeryd``)
     Path to the state database.  The extension '.db' may
     be appended to the filename.  Default: {default}
 
-.. cmdoption:: -E, --events
+.. cmdoption:: -E, --task-events
 
     Send task-related events that can be captured by monitors like
     :program:`celery events`, `celerymon`, and others.
@@ -106,12 +106,12 @@ The :program:`celery worker` command (previously known as ``celeryd``)
 
     Enables a soft time limit (in seconds int/float) for tasks.
 
-.. cmdoption:: --maxtasksperchild
+.. cmdoption:: --max-tasks-per-child
 
     Maximum number of tasks a pool worker can execute before it's
     terminated and replaced by a new worker.
 
-.. cmdoption:: --maxmemperchild
+.. cmdoption:: --max-memory-per-child
 
     Maximum amount of resident memory, in KiB, that may be consumed by a
     child process before it will be replaced by a new one.  If a single
@@ -216,7 +216,7 @@ class worker(Command):
             raise SystemExit(0)
 
     def run(self, hostname=None, pool_cls=None, app=None, uid=None, gid=None,
-            loglevel=None, logfile=None, pidfile=None, state_db=None,
+            loglevel=None, logfile=None, pidfile=None, statedb=None,
             **kwargs):
         maybe_drop_privileges(uid=uid, gid=gid)
         # Pools like eventlet/gevent needs to patch libs as early
@@ -239,7 +239,7 @@ class worker(Command):
             hostname=hostname, pool_cls=pool_cls, loglevel=loglevel,
             logfile=logfile,  # node format handled by celery.app.log.setup
             pidfile=self.node_format(pidfile, hostname),
-            state_db=self.node_format(state_db, hostname), **kwargs
+            statedb=self.node_format(statedb, hostname), **kwargs
         )
         worker.start()
         return worker.exitcode
@@ -257,14 +257,13 @@ class worker(Command):
         wopts.add_option('-D', '--detach', action='store_true')
         wopts.add_option(
             '-S', '--statedb',
-            default=conf.worker_state_db, dest='state_db',
+            default=conf.worker_state_db)
         )
         wopts.add_option('-l', '--loglevel', default='WARN')
         wopts.add_option('-O', dest='optimization')
         wopts.add_option(
             '--prefetch-multiplier',
-            dest='prefetch_multiplier', type='int',
-            default=conf.worker_prefetch_multiplier,
+            type='int', default=conf.worker_prefetch_multiplier,
         )
         parser.add_option_group(wopts)
 
@@ -275,32 +274,27 @@ class worker(Command):
         )
         topts.add_option(
             '-P', '--pool',
-            default=conf.worker_pool, dest='pool_cls',
+            default=conf.worker_pool,
         )
         topts.add_option(
-            '-E', '--events',
-            default=conf.worker_send_task_events,
-            action='store_true', dest='send_events',
+            '-E', '--task-events', '--events',
+            action='store_true', default=conf.worker_send_task_events,
         )
         topts.add_option(
             '--time-limit',
-            type='float', dest='task_time_limit',
-            default=conf.task_time_limit,
+            type='float', default=conf.task_time_limit,
         )
         topts.add_option(
             '--soft-time-limit',
-            dest='task_soft_time_limit', type='float',
-            default=conf.task_soft_time_limit,
+            type='float', default=conf.task_soft_time_limit,
         )
         topts.add_option(
-            '--maxtasksperchild',
-            dest='max_tasks_per_child', type='int',
-            default=conf.worker_max_tasks_per_child,
+            '--max-tasks-per-child', '--maxtasksperchild',
+            type='int', default=conf.worker_max_tasks_per_child,
         )
         topts.add_option(
-            '--maxmemperchild',
-            dest='max_memory_per_child', type='int',
-            default=conf.worker_max_memory_per_child,
+            '--max-memory-per-child', '--maxmemperchild',
+            type='int', default=conf.worker_max_memory_per_child,
         )
         parser.add_option_group(topts)
 
@@ -332,10 +326,10 @@ class worker(Command):
         bopts = OptionGroup(parser, 'Embedded Beat Options')
         bopts.add_option('-B', '--beat', action='store_true')
         bopts.add_option(
-            '-s', '--schedule', dest='schedule_filename',
+            '-s', '--schedule-filename', '--schedule',
             default=conf.beat_schedule_filename,
         )
-        bopts.add_option('--scheduler', dest='scheduler_cls')
+        bopts.add_option('--scheduler')
         parser.add_option_group(bopts)
 
         user_options = self.app.user_options['worker']

+ 1 - 1
celery/tests/bin/test_celeryd_detach.py

@@ -113,7 +113,7 @@ class test_Command(AppCase):
         detach.assert_called_with(
             path=x.execv_path, uid=None, gid=None,
             umask=None, fake=False, logfile='/var/log', pidfile='celeryd.pid',
-            working_directory=None, executable=None, hostname=None,
+            workdir=None, executable=None, hostname=None,
             argv=x.execv_argv + [
                 '-c', '1', '-lDEBUG',
                 '--logfile=/var/log', '--pidfile=celeryd.pid',

+ 1 - 1
celery/tests/bin/test_worker.py

@@ -166,7 +166,7 @@ class test_Worker(WorkerAppCase):
         self.assertTrue(worker.startup_info())
 
         self.app.loader = prev_loader
-        worker.send_events = True
+        worker.task_events = True
         self.assertTrue(worker.startup_info())
 
         # test when there are too few output lines

+ 5 - 5
celery/tests/worker/test_worker.py

@@ -274,7 +274,7 @@ class test_Consumer(AppCase):
         self.assertTrue(self.timer.empty())
 
     def test_start_channel_error(self):
-        c = self.NoopConsumer(send_events=False, pool=BasePool())
+        c = self.NoopConsumer(task_events=False, pool=BasePool())
         c.loop.on_nth_call_do_raise(KeyError('foo'), SyntaxError('bar'))
         c.channel_errors = (KeyError,)
         try:
@@ -284,7 +284,7 @@ class test_Consumer(AppCase):
             c.timer and c.timer.stop()
 
     def test_start_connection_error(self):
-        c = self.NoopConsumer(send_events=False, pool=BasePool())
+        c = self.NoopConsumer(task_events=False, pool=BasePool())
         c.loop.on_nth_call_do_raise(KeyError('foo'), SyntaxError('bar'))
         c.connection_errors = (KeyError,)
         try:
@@ -661,7 +661,7 @@ class test_Consumer(AppCase):
         self.assertEqual(c.qos.prev, c.qos.value)
 
         init_callback.reset_mock()
-        c = self.NoopConsumer(send_events=False, init_callback=init_callback)
+        c = self.NoopConsumer(task_events=False, init_callback=init_callback)
         c.qos = _QoS()
         c.connection = Connection()
         c.loop = Mock(side_effect=socket.error('foo'))
@@ -886,13 +886,13 @@ class test_WorkController(AppCase):
         worker2.start()
         self.assertTrue(sec.stop.call_count)
 
-    def test_state_db(self):
+    def test_statedb(self):
         from celery.worker import state
         Persistent = state.Persistent
 
         state.Persistent = Mock()
         try:
-            worker = self.create_worker(state_db='statefilename')
+            worker = self.create_worker(statedb='statefilename')
             self.assertTrue(worker._persistence)
         finally:
             state.Persistent = Persistent

+ 22 - 11
celery/worker/__init__.py

@@ -350,12 +350,21 @@ class WorkController(object):
         return state
 
     def setup_defaults(self, concurrency=None, loglevel='WARN', logfile=None,
-                       send_events=None, pool_cls=None, consumer_cls=None,
+                       task_events=None, pool=None, consumer_cls=None,
                        timer_cls=None, timer_precision=None,
                        pool_putlocks=None, pool_restarts=None,
-                       state_db=None, schedule_filename=None,
-                       scheduler_cls=None, task_time_limit=None,
-                       task_soft_time_limit=None, max_tasks_per_child=None,
+                       optimization=None, O=None,  # O maps to -O=fair
+                       statedb=None,
+                       time_limit=None,
+                       soft_time_limit=None,
+                       scheduler=None,
+                       pool_cls=None,              # XXX use pool
+                       state_db=None,              # XXX use statedb
+                       task_time_limit=None,       # XXX use time_limit
+                       task_soft_time_limit=None,  # XXX use soft_time_limit
+                       scheduler_cls=None,         # XXX use scheduler
+                       schedule_filename=None,
+                       max_tasks_per_child=None,
                        prefetch_multiplier=None, disable_rate_limits=None,
                        worker_lost_wait=None,
                        max_memory_per_child=None, **_kw):
@@ -364,23 +373,25 @@ class WorkController(object):
         self.logfile = logfile
 
         self.concurrency = either('worker_concurrency', concurrency)
-        self.send_events = either('worker_send_task_events', send_events)
-        self.pool_cls = either('worker_pool', pool_cls)
+        self.task_events = either('worker_send_task_events', task_events)
+        self.pool_cls = either('worker_pool', pool, pool_cls)
         self.consumer_cls = either('worker_consumer', consumer_cls)
         self.timer_cls = either('worker_timer', timer_cls)
         self.timer_precision = either(
             'worker_timer_precision', timer_precision,
         )
+        self.optimization = optimization or O
         self.pool_putlocks = either('worker_pool_putlocks', pool_putlocks)
         self.pool_restarts = either('worker_pool_restarts', pool_restarts)
-        self.state_db = either('worker_state_db', state_db)
+        self.statedb = either('worker_state_db', statedb, state_db)
         self.schedule_filename = either(
             'beat_schedule_filename', schedule_filename,
         )
-        self.scheduler_cls = either('beat_scheduler', scheduler_cls)
-        self.task_time_limit = either('task_time_limit', task_time_limit)
-        self.task_soft_time_limit = either(
-            'task_soft_time_limit', task_soft_time_limit,
+        self.scheduler = either('beat_scheduler', scheduler, scheduler_cls)
+        self.time_limit = either(
+            'task_time_limit', time_limit, task_time_limit)
+        self.soft_time_limit = either(
+            'task_soft_time_limit', soft_time_limit, task_soft_time_limit,
         )
         self.max_tasks_per_child = either(
             'worker_max_tasks_per_child', max_tasks_per_child,

+ 8 - 8
celery/worker/components.py

@@ -107,11 +107,11 @@ class Pool(bootsteps.StartStopStep):
     """
     requires = (Hub,)
 
-    def __init__(self, w, optimization=None, **kwargs):
+    def __init__(self, w, **kwargs):
         w.pool = None
         w.max_concurrency = None
         w.min_concurrency = w.concurrency
-        self.optimization = optimization
+        self.optimization = w.optimization
 
     def close(self, w):
         if w.pool:
@@ -141,8 +141,8 @@ class Pool(bootsteps.StartStopStep):
             initargs=(w.app, w.hostname),
             maxtasksperchild=w.max_tasks_per_child,
             max_memory_per_child=w.max_memory_per_child,
-            timeout=w.task_time_limit,
-            soft_timeout=w.task_soft_time_limit,
+            timeout=w.time_limit,
+            soft_timeout=w.soft_time_limit,
             putlocks=w.pool_putlocks and threaded,
             lost_worker_timeout=w.worker_lost_wait,
             threads=threaded,
@@ -181,7 +181,7 @@ class Beat(bootsteps.StartStopStep):
             raise ImproperlyConfigured(ERR_B_GREEN)
         b = w.beat = EmbeddedService(w.app,
                                      schedule_filename=w.schedule_filename,
-                                     scheduler_cls=w.scheduler_cls)
+                                     scheduler_cls=w.scheduler)
         return b
 
 
@@ -189,11 +189,11 @@ class StateDB(bootsteps.Step):
     """This bootstep sets up the workers state db if enabled."""
 
     def __init__(self, w, **kwargs):
-        self.enabled = w.state_db
+        self.enabled = w.statedb
         w._persistence = None
 
     def create(self, w):
-        w._persistence = w.state.Persistent(w.state, w.state_db, w.app.clock)
+        w._persistence = w.state.Persistent(w.state, w.statedb, w.app.clock)
         atexit.register(w._persistence.save)
 
 
@@ -209,7 +209,7 @@ class Consumer(bootsteps.StartStopStep):
         c = w.consumer = self.instantiate(
             w.consumer_cls, w.process_task,
             hostname=w.hostname,
-            send_events=w.send_events,
+            task_events=w.task_events,
             init_callback=w.ready_callback,
             initial_prefetch_count=prefetch_count,
             pool=w.pool,

+ 3 - 3
celery/worker/consumer/events.py

@@ -17,11 +17,11 @@ class Events(bootsteps.StartStopStep):
 
     requires = (Connection,)
 
-    def __init__(self, c, send_events=True,
+    def __init__(self, c, task_events=True,
                  without_heartbeat=False, without_gossip=False, **kwargs):
-        self.groups = None if send_events else ['worker']
+        self.groups = None if task_events else ['worker']
         self.send_events = (
-            send_events or
+            task_events or
             not without_gossip or
             not without_heartbeat
         )

+ 2 - 2
docs/getting-started/introduction.rst

@@ -194,11 +194,11 @@ Features
 
         - **Resource Leak Protection**
 
-            The :option:`--maxtasksperchild <celery worker --maxtasksperchild>`
+            The :option:`--max-tasks-per-child <celery worker --max-tasks-per-child>`
             option is used for user tasks leaking resources, like memory or
             file descriptors, that are simply out of your control.
 
-            :ref:`Read more… <worker-maxtasksperchild>`.
+            :ref:`Read more… <worker-max-tasks-per-child>`.
 
         - **User Components**
 

+ 5 - 5
docs/userguide/workers.rst

@@ -189,7 +189,7 @@ filename depending on the process that'll eventually need to open the file.
 This can be used to specify one log file per child process.
 
 Note that the numbers will stay within the process limit even if processes
-exit or if ``maxtasksperchild``/time limits are used. That is, the number
+exit or if ``max-tasks-per-child``/time limits are used. That is, the number
 is the *process index*, not the process count or pid.
 
 * ``%i`` - Pool process index or 0 if MainProcess.
@@ -527,7 +527,7 @@ list of workers you can include the ``destination`` argument:
     This won't affect workers with the
     :setting:`worker_disable_rate_limits` setting enabled.
 
-.. _worker-maxtasksperchild:
+.. _worker-max-tasks-per-child:
 
 Max tasks per child setting
 ===========================
@@ -543,10 +543,10 @@ This is useful if you have memory leaks you have no control over
 for example from closed source C extensions.
 
 The option can be set using the workers
-:option:`--maxtasksperchild <celery worker --maxtasksperchild>` argument
+:option:`--max-tasks-per-child <celery worker --max-tasks-per-child>` argument
 or using the :setting:`worker_max_tasks_per_child` setting.
 
-.. _worker-maxmemperchild:
+.. _worker-max-memory-per-child:
 
 Max memory per child setting
 ============================
@@ -562,7 +562,7 @@ This is useful if you have memory leaks you have no control over
 for example from closed source C extensions.
 
 The option can be set using the workers
-:option:`--maxmemperchild <celery worker --maxmemperchild>` argument
+:option:`--max-memory-per-child <celery worker --max-memory-per-child>` argument
 or using the :setting:`worker_max_memory_per_child` setting.
 
 .. _worker-queues:

+ 2 - 2
docs/whatsnew-4.0.rst

@@ -780,7 +780,7 @@ Prefork: Limit child process resident memory size
 
 You can now limit the maximum amount of memory allocated per prefork
 pool child process by setting the worker
-:option:`--maxmemperchild <celery worker --maxmemperchild>` option,
+:option:`--max-memory-per-child <celery worker --max-memory-per-child>` option,
 or the :setting:`worker_max_memory_per_child` setting.
 
 The limit is for RSS/resident memory size and is specified in kilobytes.
@@ -788,7 +788,7 @@ The limit is for RSS/resident memory size and is specified in kilobytes.
 A child process having exceeded the limit will be terminated and replaced
 with a new process after the currently executing task returns.
 
-See :ref:`worker-maxmemperchild` for more information.
+See :ref:`worker-max-memory-per-child` for more information.
 
 Contributed by **Dave Smith**.
 

+ 1 - 1
extra/bash-completion/celery.bash

@@ -74,7 +74,7 @@ _celery()
     worker)
         COMPREPLY=( $(compgen -W '--concurrency= --pool= --purge --logfile=
         --loglevel= --hostname= --beat --schedule= --scheduler= --statedb= --events
-        --time-limit= --soft-time-limit= --maxtasksperchild= --queues=
+        --time-limit= --soft-time-limit= --max-tasks-per-child= --queues=
         --include= --pidfile= $fargs' -- ${cur} ) )
         return 0
         ;;

+ 1 - 1
extra/zsh-completion/celery.zsh

@@ -51,7 +51,7 @@ case "$words[1]" in
     '(-E --events)'{-E,--events}'[Send events that can be captured by monitors like celeryev, celerymon, and others.]' \
     '(--time-limit=)--time-limit=[nables a hard time limit (in seconds int/float) for tasks]' \
     '(--soft-time-limit=)--soft-time-limit=[Enables a soft time limit (in seconds int/float) for tasks]' \
-    '(--maxtasksperchild=)--maxtasksperchild=[Maximum number of tasks a pool worker can execute before it"s terminated and replaced by a new worker.]' \
+    '(--max-tasks-per-child=)--max-tasks-per-child=[Maximum number of tasks a pool worker can execute before it"s terminated and replaced by a new worker.]' \
     '(-Q --queues=)'{-Q,--queues=}'[List of queues to enable for this worker, separated by comma. By default all configured queues are enabled.]' \
     '(-I --include=)'{-I,--include=}'[Comma separated list of additional modules to import.]' \
     '(--pidfile=)--pidfile=[Optional file used to store the process pid.]' \