Note that there are some explanatory texts on larger screens.

plurals
  1. POIs ResultSet used by celery.group using the wrong method to `add` a result?
    text
    copied!<p>Is <code>ResultSet</code> used by celery.group using the wrong method to <code>add</code> a result?</p> <p>The version of celery I'm using is 3.0.24</p> <h2>the gist</h2> <pre><code># primary celery module celery = Celery(...) # task module from celery import current_app @current_app.task(max_retries=5) def get_page(url): # do stuff to "get page" return page # program from celery import group url = "http://someurl" if not groupresult: groupresult = group([get_page.s(url)]).apply_async() else: async = get_page.delay(url) groupresult.add(async) </code></pre> <h3>and the traceback this produces...</h3> <pre><code>File "/lib/python2.7/site-packages/celery/result.py", line 308, in add self.results.append(result) AttributeError: 'tuple' object has no attribute 'append' </code></pre> <h3>The bottom of <a href="http://hastebin.com/kurecotawa.py" rel="nofollow">this hastebin</a> has the associated celery source code</h3> <hr> <h3>EDIT 0</h3> <p>Some additional info, in case it matters:</p> <p>I'm actually starting my celery worker elsewhere, using <code>-P eventlet</code>, a redis broker, and a redis backend. I have been using this config for a while with success.</p> <p>Also, updated the gist above to be more specific, using <code>current_app</code>.</p> <hr> <h3>EDIT 1</h3> <p>The issue lies in <code>celery/app/builtins.py</code>, around <a href="https://github.com/celery/celery/blob/v3.0.24/celery/app/builtins.py#L200" rel="nofollow">here</a>. I'd have to force <code>results</code> to be a list rather than a tuple before passing it to <code>GroupResult</code> to get this to work.</p> <p>celery: <a href="http://docs.celeryproject.org/en/latest/reference/celery.html#grouping-tasks" rel="nofollow">Grouping Tasks</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload