Explorar o código

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

Ask Solem %!s(int64=12) %!d(string=hai) anos
pai
achega
d20509692c
Modificáronse 1 ficheiros con 4 adicións e 0 borrados
  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