瀏覽代碼

-A mod will now find any celery instance in the module

Ask Solem 12 年之前
父節點
當前提交
d20509692c
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. 4 0
      celery/bin/base.py

+ 4 - 0
celery/bin/base.py

@@ -407,6 +407,10 @@ class Command(object):
                 if getattr(sym, '__path__', None):
                     return self.find_app('{0}.celery:'.format(
                                          app.replace(':', '')))
+                from celery.app.base import Celery
+                for suspect in vars(sym).itervalues():
+                    if isinstance(suspect, Celery):
+                        return suspect
                 raise
         return sym