|
@@ -28,7 +28,7 @@ from kombu.utils import kwdict
|
|
|
|
|
|
from celery import current_app
|
|
from celery import current_app
|
|
from celery import states, signals
|
|
from celery import states, signals
|
|
-from celery.state import _task_stack
|
|
|
|
|
|
+from celery.state import _task_stack, default_app
|
|
from celery.app.task import BaseTask, Context
|
|
from celery.app.task import BaseTask, Context
|
|
from celery.datastructures import ExceptionInfo
|
|
from celery.datastructures import ExceptionInfo
|
|
from celery.exceptions import RetryTaskError
|
|
from celery.exceptions import RetryTaskError
|
|
@@ -49,6 +49,8 @@ RETRY = states.RETRY
|
|
FAILURE = states.FAILURE
|
|
FAILURE = states.FAILURE
|
|
EXCEPTION_STATES = states.EXCEPTION_STATES
|
|
EXCEPTION_STATES = states.EXCEPTION_STATES
|
|
|
|
|
|
|
|
+_tasks = default_app._tasks
|
|
|
|
+
|
|
|
|
|
|
def mro_lookup(cls, attr, stop=()):
|
|
def mro_lookup(cls, attr, stop=()):
|
|
"""Returns the first node by MRO order that defines an attribute.
|
|
"""Returns the first node by MRO order that defines an attribute.
|
|
@@ -290,7 +292,7 @@ def trace_task(task, uuid, args, kwargs, request=None, **opts):
|
|
|
|
|
|
|
|
|
|
def trace_task_ret(task, uuid, args, kwargs, request):
|
|
def trace_task_ret(task, uuid, args, kwargs, request):
|
|
- return task.__tracer__(uuid, args, kwargs, request)[0]
|
|
|
|
|
|
+ return _tasks[task].__tracer__(uuid, args, kwargs, request)[0]
|
|
|
|
|
|
|
|
|
|
def eager_trace_task(task, uuid, args, kwargs, request=None, **opts):
|
|
def eager_trace_task(task, uuid, args, kwargs, request=None, **opts):
|