瀏覽代碼

Hey! Trying to limit the usage of .conf here!

Ask Solem 15 年之前
父節點
當前提交
697b3513fd
共有 2 個文件被更改,包括 4 次插入4 次删除
  1. 3 1
      celery/bin/celeryd.py
  2. 1 3
      celery/utils/info.py

+ 3 - 1
celery/bin/celeryd.py

@@ -269,9 +269,11 @@ class Worker(object):
             include_builtins = self.loglevel <= logging.DEBUG
             include_builtins = self.loglevel <= logging.DEBUG
             tasklist = self.tasklist(include_builtins=include_builtins)
             tasklist = self.tasklist(include_builtins=include_builtins)
 
 
+        routing_table = conf.get_routing_table()
+
         return STARTUP_INFO_FMT % {
         return STARTUP_INFO_FMT % {
             "conninfo": info.format_broker_info(),
             "conninfo": info.format_broker_info(),
-            "queues": info.format_routing_table(indent=8),
+            "queues": info.format_routing_table(routing_table, indent=8),
             "concurrency": self.concurrency,
             "concurrency": self.concurrency,
             "loglevel": conf.LOG_LEVELS[self.loglevel],
             "loglevel": conf.LOG_LEVELS[self.loglevel],
             "logfile": self.logfile or "[stderr]",
             "logfile": self.logfile or "[stderr]",

+ 1 - 3
celery/utils/info.py

@@ -1,6 +1,5 @@
 import math
 import math
 
 
-from celery import conf
 from celery.messaging import establish_connection
 from celery.messaging import establish_connection
 
 
 ROUTE_FORMAT = """
 ROUTE_FORMAT = """
@@ -31,9 +30,8 @@ def textindent(t, indent=0):
     return "\n".join(" " * indent + p for p in t.split("\n"))
     return "\n".join(" " * indent + p for p in t.split("\n"))
 
 
 
 
-def format_routing_table(table=None, indent=0):
+def format_routing_table(table, indent=0):
     """Format routing table into string for log dumps."""
     """Format routing table into string for log dumps."""
-    table = table or conf.get_routing_table()
     format = lambda **route: ROUTE_FORMAT.strip() % route
     format = lambda **route: ROUTE_FORMAT.strip() % route
     routes = "\n".join(format(name=name, **route)
     routes = "\n".join(format(name=name, **route)
                             for name, route in table.items())
                             for name, route in table.items())