Forráskód Böngészése

Merge branch 'master' of github.com:celery/celery

Ask Solem 8 éve
szülő
commit
039f665ff3

+ 1 - 0
CONTRIBUTORS.txt

@@ -213,3 +213,4 @@ Takeshi Kanemoto, 2016/04/22
 Arthur Vuillard, 2016/04/22
 Colin McIntosh, 2016/04/26
 Jeremy Zafran, 2016/05/17
+Anand Reddy Pandikunta, 2016/06/18

+ 1 - 1
celery/app/base.py

@@ -729,7 +729,7 @@ class Celery(object):
         :keyword failover_strategy: Custom failover strategy.
         :keyword \*\*kwargs: Additional arguments to :class:`kombu.Connection`.
 
-        :returns :class:`kombu.Connection`:
+        :returns: :class:`kombu.Connection`
 
         """
         return self.connection_for_write(

+ 1 - 1
celery/app/task.py

@@ -373,7 +373,7 @@ class Task(object):
         :param \*args: positional arguments passed on to the task.
         :param \*\*kwargs: keyword arguments passed on to the task.
 
-        :returns :class:`celery.result.AsyncResult`:
+        :returns: :class:`celery.result.AsyncResult`
 
         """
         return self.apply_async(args, kwargs)

+ 6 - 1
celery/bin/multi.py

@@ -458,9 +458,14 @@ def _args_for_node(p, name, prefix, suffix, cmd, append, options):
     name, nodename, expand = _get_nodename(
         name, prefix, suffix, options)
 
+    if nodename in p.namespaces:
+        ns = nodename
+    else:
+        ns = name
+
     argv = ([expand(cmd)] +
             [format_opt(opt, expand(value))
-                for opt, value in items(p.optmerge(name, options))] +
+                for opt, value in items(p.optmerge(ns, options))] +
             [p.passthrough])
     if append:
         argv.append(expand(append))

+ 16 - 0
celery/tests/bin/test_multi.py

@@ -149,6 +149,22 @@ class test_multi_args(AppCase):
              ['COMMAND', '-n foo@', '-c 5', '']),
         )
 
+        p4 = NamespacedOptionParser(['foo', '-Q:1', 'test'])
+        names6 = list(multi_args(p4, cmd='COMMAND', suffix='""'))
+        self.assertEqual(
+            names6[0][0:2],
+            ('foo@',
+             ['COMMAND', '-n foo@', '-Q test', '']),
+        )
+
+        p5 = NamespacedOptionParser(['foo@bar', '-Q:1', 'test'])
+        names7 = list(multi_args(p5, cmd='COMMAND', suffix='""'))
+        self.assertEqual(
+            names7[0][0:2],
+            ('foo@bar',
+             ['COMMAND', '-n foo@bar', '-Q test', '']),
+        )
+
 
 class test_MultiTool(AppCase):
 

+ 1 - 1
celery/utils/objects.py

@@ -26,7 +26,7 @@ def mro_lookup(cls, attr, stop=set(), monkey_patched=[]):
         attributes module origin is not in this list, this to detect
         monkey patched attributes.
 
-    :returns None: if the attribute was not found.
+    :returns: None if the attribute was not found.
 
     """
     for node in cls.mro():

+ 2 - 1
docs/configuration.rst

@@ -1751,7 +1751,8 @@ Default (since 2.5) is to use a pool of 10 connections.
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 The default timeout in seconds before we give up establishing a connection
-to the AMQP server.  Default is 4 seconds.
+to the AMQP server.  Default is 4 seconds. This setting is disabled when using
+gevent.
 
 .. setting:: broker_connection_retry
 

+ 3 - 1
docs/tutorials/daemonizing.rst

@@ -81,7 +81,7 @@ This is an example configuration for a Python project.
     #   most people will only start one node:
     CELERYD_NODES="worker1"
     #   but you can also start multiple and configure settings
-    #   for each in CELERYD_OPTS (see `celery multi --help` for examples):
+    #   for each in CELERYD_OPTS
     #CELERYD_NODES="worker1 worker2 worker3"
     #   alternatively, you can specify the number of nodes to start:
     #CELERYD_NODES=10
@@ -101,6 +101,8 @@ This is an example configuration for a Python project.
 
     # Extra command-line arguments to the worker
     CELERYD_OPTS="--time-limit=300 --concurrency=8"
+    # Configure node-specific settings by appending node name to arguments:
+    #CELERYD_OPTS="--time-limit=300 -c 8 -c:worker2 4 -c:worker3 2 -Ofair:worker1"
 
     # Set logging level to DEBUG
     #CELERYD_LOG_LEVEL="DEBUG"