title: django celery: update_state not doing anything
body: <p>I am writing a small test task for django-celery, in which I would like to set a custom state (and some data, but let's start with a custom state first).</p>
  
  <p>I use django as the messaging backend. My version of python is 2.6.</p>
  
  <p>Here's the content of tasks.py</p>
  
  <pre class="lang-py prettyprint-override"><code>import time
  from djcelery import celery
  
  @celery.task
  def generate():
      generate.update_state(state="PROGRESS")
      time.sleep(10)
      return True
  </code></pre>
  
  <p>And here's what happens when I give it a try:</p>
  
  <pre class="lang-py prettyprint-override"><code>&gt;&gt;&gt; import tasks
  &gt;&gt;&gt; result = tasks.generate.delay()
  &gt;&gt;&gt; result
  &lt;AsyncResult: f72574aa-f8c5-49dc-89d4-47d2012a4d6d&gt;
  
  # status and state are the same, but just to make sure
  &gt;&gt;&gt; result.status
  u'PENDING'
  &gt;&gt;&gt; result.state
  u'PENDING'
  &gt;&gt;&gt; result.result
  # empty, as in None
  
  # wait a few seconds
  &gt;&gt;&gt; result.status
  u'SUCCESS'
  &gt;&gt;&gt; result.state
  u'SUCCESS'
  &gt;&gt;&gt; result.result
  True
  </code></pre>
  
  <p>I can't figure out why the state is PENDING while it should be PROGRESS. Any idea?</p>
  
  <p>I've already looked at the documentation, and here's the relevant link: <a href="http://docs.celeryproject.org/en/latest/userguide/tasks.html#custom-states" rel="nofollow">http://docs.celeryproject.org/en/latest/userguide/tasks.html#custom-states</a></p>
  
  <p>I do the exact same thing (minus the meta, but I also tried without success), so it should work.</p>
  
  <p><strong>UPDATE: I found out why, looks like you have to restart the celery daemon whenever you update your tasks so that the changes are taken into account.</strong></p>