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 = {
 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()
             >>> publisher.connection.close()
 
 
         """
         """
-       
+
         connection = DjangoAMQPConnection(connect_timeout=connect_timeout)
         connection = DjangoAMQPConnection(connect_timeout=connect_timeout)
         return TaskPublisher(connection=connection,
         return TaskPublisher(connection=connection,
                              exchange=self.exchange,
                              exchange=self.exchange,

+ 1 - 0
celery/utils.py

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

+ 3 - 3
celery/worker/__init__.py

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