Browse Source

Fixes required for Flask-Celery to work

Ask Solem 14 years ago
parent
commit
c09e686897
3 changed files with 4 additions and 1 deletions
  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
         return c
 
 
     def post_config_merge(self, 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
         """Prepare configuration after it has been merged with the
         defaults."""
         defaults."""
         if not c.get("CELERY_QUEUES"):
         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):
     def setup_app_from_commandline(self, argv):
         preload_options = self.parse_preload_options(argv)
         preload_options = self.parse_preload_options(argv)
         app = (preload_options.pop("app", None) or
         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
         loader = (preload_options.pop("loader", None) or
                   os.environ.get("CELERY_LOADER") or
                   os.environ.get("CELERY_LOADER") or
                   "default")
                   "default")

+ 1 - 0
celery/task/base.py

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