Ask Solem 16 年之前
父節點
當前提交
9209f38139
共有 4 個文件被更改,包括 9 次插入8 次删除
  1. 4 4
      celery/conf.py
  2. 1 1
      celery/task/base.py
  3. 1 0
      celery/utils.py
  4. 3 3
      celery/worker/__init__.py

+ 4 - 4
celery/conf.py

@@ -146,10 +146,10 @@ AMQP_CONSUMER_QUEUE = getattr(settings, "CELERY_AMQP_CONSUMER_QUEUE",
 
 """
 DEFAULT_AMQP_CONSUMER_QUEUES = {
-        AMQP_CONSUMER_QUEUE : {
-            "exchange" : AMQP_EXCHANGE,
-            "routing_key" : AMQP_CONSUMER_ROUTING_KEY,
-            "exchange_type" : AMQP_EXCHANGE_TYPE
+        AMQP_CONSUMER_QUEUE: {
+            "exchange": AMQP_EXCHANGE,
+            "routing_key": AMQP_CONSUMER_ROUTING_KEY,
+            "exchange_type": AMQP_EXCHANGE_TYPE,
         }
 }
 

+ 1 - 1
celery/task/base.py

@@ -154,7 +154,7 @@ class Task(object):
             >>> publisher.connection.close()
 
         """
-       
+
         connection = DjangoAMQPConnection(connect_timeout=connect_timeout)
         return TaskPublisher(connection=connection,
                              exchange=self.exchange,

+ 1 - 0
celery/utils.py

@@ -55,6 +55,7 @@ def get_full_cls_name(cls):
     return ".".join([cls.__module__,
                      cls.__name__])
 
+
 def repeatlast(it):
     """Iterate over all elements in the iterator, and when its exhausted
     yield the last value infinitely."""

+ 3 - 3
celery/worker/__init__.py

@@ -52,7 +52,7 @@ class AMQPListener(object):
 
     def start(self):
         """Start the consumer.
-        
+
         If the connection is lost, it tries to re-establish the connection
         over time and restart consuming messages.
 
@@ -78,7 +78,7 @@ class AMQPListener(object):
 
         while True:
             it.next()
-        
+
     def stop(self):
         """Stop processing AMQP messages and close the connection
         to the broker."""
@@ -139,7 +139,7 @@ class AMQPListener(object):
         See :func:`carrot.utils.retry_over_time`.
 
         """
-        
+
         def _connection_error_handler(exc, interval):
             """Callback handler for connection errors."""
             self.logger.error("AMQP Listener: Connection Error: %s. " % exc