Преглед на файлове

Fixes required for Flask-Celery to work

Ask Solem преди 14 години
родител
ревизия
c09e686897
променени са 3 файла, в които са добавени 4 реда и са изтрити 1 реда
  1. 1 0
      celery/app/base.py
  2. 2 1
      celery/bin/base.py
  3. 1 0
      celery/task/base.py

+ 1 - 0
celery/app/base.py

@@ -208,6 +208,7 @@ class BaseApp(object):
         return c
 
     def post_config_merge(self, c):
+        # XXX This should be done by whoever requires these settings.
         """Prepare configuration after it has been merged with the
         defaults."""
         if not c.get("CELERY_QUEUES"):

+ 2 - 1
celery/bin/base.py

@@ -69,7 +69,8 @@ class Command(object):
     def setup_app_from_commandline(self, argv):
         preload_options = self.parse_preload_options(argv)
         app = (preload_options.pop("app", None) or
-               os.environ.get("CELERY_APP"))
+               os.environ.get("CELERY_APP") or
+               self.app)
         loader = (preload_options.pop("loader", None) or
                   os.environ.get("CELERY_LOADER") or
                   "default")

+ 1 - 0
celery/task/base.py

@@ -729,6 +729,7 @@ def create_task_cls(app, **kwargs):
     apps = [app]
 
     class Task(BaseTask):
+        abstract = True
         app = apps[0]
         backend = app.backend
         exchange_type = app.conf.CELERY_DEFAULT_EXCHANGE_TYPE