Ask Solem 12 năm trước cách đây
mục cha
commit
bcb47a924e
2 tập tin đã thay đổi với 7 bổ sung7 xóa
  1. 5 5
      celery/events/state.py
  2. 2 2
      celery/task/__init__.py

+ 5 - 5
celery/events/state.py

@@ -329,9 +329,9 @@ class State(object):
         Returns a list of `(uuid, task)` tuples.
 
         """
-        sorted_tasks = self._sort_tasks_by_time([(uuid, task)
-                                                 for uuid, task in self.tasks.iteritems()
-                                                 if task.name == name])
+        sorted_tasks = self._sort_tasks_by_time((uuid, task)
+                for uuid, task in self.tasks.iteritems()
+                    if task.name == name)
 
         return sorted_tasks[0:limit or None]
 
@@ -341,9 +341,9 @@ class State(object):
         Returns a list of `(uuid, task)` tuples.
 
         """
-        return self._sort_tasks_by_time([(uuid, task)
+        return self._sort_tasks_by_time((uuid, task)
                 for uuid, task in self.itertasks(limit)
-                    if task.worker.hostname == hostname])
+                    if task.worker.hostname == hostname)
 
     def task_types(self):
         """Returns a list of all seen task types."""

+ 2 - 2
celery/task/__init__.py

@@ -27,7 +27,7 @@ if STATICA_HACK:
     # This is never executed, but tricks static analyzers (PyDev, PyCharm,
     # pylint, etc.) into knowing the types of these symbols, and what
     # they contain.
-    from celery.canvas import chain, group, chord, subtask
+    from celery.canvas import group, chord, subtask
     from .base import BaseTask, Task, PeriodicTask, task, periodic_task
     from .sets import TaskSet
 
@@ -42,7 +42,7 @@ old_module, new_module = recreate_module(__name__,  # pragma: no cover
     by_module={
         'celery.task.base':   ['BaseTask', 'Task', 'PeriodicTask',
                                'task', 'periodic_task'],
-        'celery.canvas':      ['chain', 'group', 'chord', 'subtask'],
+        'celery.canvas':      ['group', 'chord', 'subtask'],
         'celery.task.sets':   ['TaskSet'],
     },
     base=module,