Ask Solem 15 jaren geleden
bovenliggende
commit
0a19c9ff2d
3 gewijzigde bestanden met toevoegingen van 11 en 8 verwijderingen
  1. 1 0
      celery/conf.py
  2. 3 2
      celery/managers.py
  3. 7 6
      celery/task/control.py

+ 1 - 0
celery/conf.py

@@ -136,6 +136,7 @@ def _find_deprecated_queue_settings():
                             "exchange_type": DEFAULT_EXCHANGE_TYPE,
                             "binding_key": binding_key}}
 
+
 def _warn_if_deprecated_queue_settings():
     for setting, new_setting in _DEPRECATIONS.items():
         if _get(setting):

+ 3 - 2
celery/managers.py

@@ -11,7 +11,7 @@ class TaskManager(models.Manager):
 
     def get_task(self, task_id, exception_retry_count=1):
         """Get task meta for task by ``task_id``.
-        
+
         :keyword exception_retry_count: How many times to retry with
             transaction rollback on exception. 1 by default: we assume
             the pessimistic case when we get race condition in which
@@ -81,6 +81,7 @@ class TaskManager(models.Manager):
             # until we rollback transaction
             if exception_retry_count > 0:
                 transaction.rollback_unless_managed()
-                self.store_result(task_id, result, status, traceback, exception_retry_count-1)
+                self.store_result(task_id, result, status, traceback,
+                                  exception_retry_count - 1)
             else:
                 raise

+ 7 - 6
celery/task/control.py

@@ -30,8 +30,8 @@ def revoke(task_id, destination=None, connection=None,
     :param task_id: Id of the task to revoke.
     :keyword destination: If set, a list of the hosts to send the command to,
         when empty broadcast to all workers.
-    :keyword connection: Custom broker connection to use, if not set, a connection
-        will be established automatically.
+    :keyword connection: Custom broker connection to use, if not set,
+        a connection will be established automatically.
     :keyword connect_timeout: Timeout for new connection if a custom
         connection is not provided.
 
@@ -50,8 +50,8 @@ def rate_limit(task_name, rate_limit, destination=None, connection=None,
       for more information).
     :keyword destination: If set, a list of the hosts to send the command to,
         when empty broadcast to all workers.
-    :keyword connection: Custom broker connection to use, if not set, a connection
-        will be established automatically.
+    :keyword connection: Custom broker connection to use, if not set,
+        a connection will be established automatically.
     :keyword connect_timeout: Timeout for new connection if a custom
         connection is not provided.
 
@@ -60,6 +60,7 @@ def rate_limit(task_name, rate_limit, destination=None, connection=None,
                                    arguments={"task_name": task_name,
                                               "rate_limit": rate_limit})
 
+
 @with_connection
 def broadcast(command, arguments=None, destination=None, connection=None,
         connect_timeout=conf.BROKER_CONNECTION_TIMEOUT):
@@ -69,8 +70,8 @@ def broadcast(command, arguments=None, destination=None, connection=None,
     :param arguments: Keyword arguments for the command.
     :keyword destination: If set, a list of the hosts to send the command to,
         when empty broadcast to all workers.
-    :keyword connection: Custom broker connection to use, if not set, a connection
-        will be established automatically.
+    :keyword connection: Custom broker connection to use, if not set,
+        a connection will be established automatically.
     :keyword connect_timeout: Timeout for new connection if a custom
         connection is not provided.