Bladeren bron

Merge branch 'master' of github.com:ask/celery

Ask Solem 13 jaren geleden
bovenliggende
commit
caca8ff9c1
2 gewijzigde bestanden met toevoegingen van 10 en 0 verwijderingen
  1. 6 0
      celery/app/base.py
  2. 4 0
      celery/exceptions.py

+ 6 - 0
celery/app/base.py

@@ -13,6 +13,7 @@ from __future__ import absolute_import
 from __future__ import with_statement
 
 import os
+import warnings
 import platform as _platform
 
 from contextlib import contextmanager
@@ -23,6 +24,7 @@ from kombu.clocks import LamportClock
 
 from .. import datastructures
 from .. import platforms
+from ..exceptions import AlwaysEagerIgnored
 from ..utils import cached_property, instantiate, lpmerge
 
 from .defaults import DEFAULTS, find_deprecated_settings, find
@@ -158,6 +160,10 @@ class BaseApp(object):
         :meth:`~celery.app.task.BaseTask.apply_async`.
 
         """
+        if self.conf.CELERY_ALWAYS_EAGER:
+            warnings.warn(AlwaysEagerIgnored(
+                "CELERY_ALWAYS_EAGER has no effect on send_task"))
+
         router = self.amqp.Router(queues)
         result_cls = result_cls or self.AsyncResult
 

+ 4 - 0
celery/exceptions.py

@@ -84,6 +84,10 @@ class NotConfigured(UserWarning):
     """Celery has not been configured, as no config module has been found."""
 
 
+class AlwaysEagerIgnored(UserWarning):
+    """send_task ignores CELERY_ALWAYS_EAGER option"""
+
+
 class InvalidTaskError(Exception):
     """The task has invalid data or is not properly constructed."""