Jelajahi Sumber

Merge branch '3.0'

Conflicts:
	celery/datastructures.py
Ask Solem 12 tahun lalu
induk
melakukan
3ec277fa94

+ 0 - 1
celery/datastructures.py

@@ -511,7 +511,6 @@ class ConfigurationView(AttributeDictMixin):
     def values(self):
         return list(self._iterate_values())
 
-
 MutableMapping.register(ConfigurationView)
 
 

+ 4 - 1
celery/worker/autoscale.py

@@ -13,6 +13,7 @@
 """
 from __future__ import absolute_import
 
+import os
 import threading
 
 from functools import partial
@@ -29,6 +30,8 @@ from .hub import DummyLock
 logger = get_logger(__name__)
 debug, info, error = logger.debug, logger.info, logger.error
 
+AUTOSCALE_KEEPALIVE = int(os.environ.get('AUTOSCALE_KEEPALIVE', 30))
+
 
 class WorkerComponent(bootsteps.StartStopStep):
     label = 'Autoscaler'
@@ -66,7 +69,7 @@ class WorkerComponent(bootsteps.StartStopStep):
 class Autoscaler(bgThread):
 
     def __init__(self, pool, max_concurrency,
-                 min_concurrency=0, keepalive=30, mutex=None):
+                 min_concurrency=0, keepalive=AUTOSCALE_KEEPALIVE, mutex=None):
         super(Autoscaler, self).__init__()
         self.pool = pool
         self.mutex = mutex or threading.Lock()

+ 6 - 0
docs/getting-started/brokers/sqs.rst

@@ -37,6 +37,12 @@ The login credentials can also be set using the environment variables
 :envvar:`AWS_ACCESS_KEY_ID` and :envvar:`AWS_SECRET_ACCESS_KEY`,
 in that case the broker url may only be ``sqs://``.
 
+.. note::
+
+    If you specify AWS credentials in the broker URL, then please keep in mind
+    that the secret access key may contain unsafe characters that needs to be
+    URL encoded.
+
 Options
 =======