Browse Source

celery.contrib.abortable is no longer using the compat task class

Ask Solem 11 năm trước cách đây
mục cha
commit
8c02b2737a
1 tập tin đã thay đổi với 3 bổ sung5 xóa
  1. 3 5
      celery/contrib/abortable.py

+ 3 - 5
celery/contrib/abortable.py

@@ -83,7 +83,7 @@ have it block until the task is finished.
 """
 from __future__ import absolute_import
 
-from celery.task.base import Task
+from celery import Task
 from celery.result import AsyncResult
 
 __all__ = ['AbortableAsyncResult', 'AbortableTask']
@@ -143,13 +143,11 @@ class AbortableTask(Task):
     the call evaluates to :const:`True`.
 
     """
-
     abstract = True
 
-    @classmethod
-    def AsyncResult(cls, task_id):
+    def AsyncResult(self, task_id):
         """Returns the accompanying AbortableAsyncResult instance."""
-        return AbortableAsyncResult(task_id, backend=cls.backend)
+        return AbortableAsyncResult(task_id, backend=self.backend)
 
     def is_aborted(self, **kwargs):
         """Checks against the backend whether this