Browse Source

Canvas: `group | group` is now unrolled into single group (Issue #2573)

Ask Solem 9 years ago
parent
commit
67c4d3e12b
1 changed files with 5 additions and 2 deletions
  1. 5 2
      celery/canvas.py

+ 5 - 2
celery/canvas.py

@@ -293,10 +293,13 @@ class Signature(dict):
         )))
 
     def __or__(self, other):
-        if isinstance(other, group):
-            other = maybe_unroll_group(other)
         if isinstance(self, group):
+            if isinstance(other, group):
+                return group(_chain(self.tasks, other.tasks), app=self.app)
             return chord(self, body=other, app=self._app)
+        elif isinstance(other, group):
+            other = maybe_unroll_group(other)
+
         if not isinstance(self, chain) and isinstance(other, chain):
             return chain((self,) + other.tasks, app=self._app)
         elif isinstance(other, chain):