|  | @@ -5,13 +5,13 @@
 | 
	
		
			
				|  |  |    <head>
 | 
	
		
			
				|  |  |      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 | 
	
		
			
				|  |  |      
 | 
	
		
			
				|  |  | -    <title>Frequently Asked Questions — Celery v0.4.1 (stable) documentation</title>
 | 
	
		
			
				|  |  | +    <title>Frequently Asked Questions — Celery v0.4.2 (stable) documentation</title>
 | 
	
		
			
				|  |  |      <link rel="stylesheet" href="static/nature.css" type="text/css" />
 | 
	
		
			
				|  |  |      <link rel="stylesheet" href="static/pygments.css" type="text/css" />
 | 
	
		
			
				|  |  |      <script type="text/javascript">
 | 
	
		
			
				|  |  |        var DOCUMENTATION_OPTIONS = {
 | 
	
		
			
				|  |  |          URL_ROOT:    '',
 | 
	
		
			
				|  |  | -        VERSION:     '0.4.1 (stable)',
 | 
	
		
			
				|  |  | +        VERSION:     '0.4.2 (stable)',
 | 
	
		
			
				|  |  |          COLLAPSE_MODINDEX: false,
 | 
	
		
			
				|  |  |          FILE_SUFFIX: '.html',
 | 
	
		
			
				|  |  |          HAS_SOURCE:  true
 | 
	
	
		
			
				|  | @@ -19,7 +19,7 @@
 | 
	
		
			
				|  |  |      </script>
 | 
	
		
			
				|  |  |      <script type="text/javascript" src="static/jquery.js"></script>
 | 
	
		
			
				|  |  |      <script type="text/javascript" src="static/doctools.js"></script>
 | 
	
		
			
				|  |  | -    <link rel="top" title="Celery v0.4.1 (stable) documentation" href="index.html" />
 | 
	
		
			
				|  |  | +    <link rel="top" title="Celery v0.4.2 (stable) documentation" href="index.html" />
 | 
	
		
			
				|  |  |      <link rel="next" title="Module API Reference" href="reference/index.html" />
 | 
	
		
			
				|  |  |      <link rel="prev" title="celery - Distributed Task Queue for Django." href="introduction.html" /> 
 | 
	
		
			
				|  |  |    </head>
 | 
	
	
		
			
				|  | @@ -39,7 +39,7 @@
 | 
	
		
			
				|  |  |          <li class="right" >
 | 
	
		
			
				|  |  |            <a href="introduction.html" title="celery - Distributed Task Queue for Django."
 | 
	
		
			
				|  |  |               accesskey="P">previous</a> |</li>
 | 
	
		
			
				|  |  | -        <li><a href="index.html">Celery v0.4.1 (stable) documentation</a> »</li> 
 | 
	
		
			
				|  |  | +        <li><a href="index.html">Celery v0.4.2 (stable) documentation</a> »</li> 
 | 
	
		
			
				|  |  |        </ul>
 | 
	
		
			
				|  |  |      </div>  
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -90,14 +90,39 @@ if it’s able to find the task, or if some other error is happening.</p>
 | 
	
		
			
				|  |  |  </div>
 | 
	
		
			
				|  |  |  <div class="section" id="why-won-t-my-periodic-task-run">
 | 
	
		
			
				|  |  |  <h3>Why won’t my Periodic Task run?<a class="headerlink" href="#why-won-t-my-periodic-task-run" title="Permalink to this headline">¶</a></h3>
 | 
	
		
			
				|  |  | -<p>See <a class="reference internal" href="#why-won-t-my-task-run">Why won’t my Task run?</a>.</p>
 | 
	
		
			
				|  |  | +<p><strong>Answer:</strong> See <a class="reference internal" href="#why-won-t-my-task-run">Why won’t my Task run?</a>.</p>
 | 
	
		
			
				|  |  | +</div>
 | 
	
		
			
				|  |  | +<div class="section" id="how-do-i-discard-all-waiting-tasks">
 | 
	
		
			
				|  |  | +<h3>How do I discard all waiting tasks?<a class="headerlink" href="#how-do-i-discard-all-waiting-tasks" title="Permalink to this headline">¶</a></h3>
 | 
	
		
			
				|  |  | +<p><strong>Answer:</strong> Use <tt class="docutils literal"><span class="pre">celery.task.discard_all()</span></tt>, like this:</p>
 | 
	
		
			
				|  |  | +<div class="highlight-python"><div class="highlight"><pre><span class="gp">>>> </span><span class="kn">from</span> <span class="nn">celery.task</span> <span class="kn">import</span> <span class="n">discard_all</span>
 | 
	
		
			
				|  |  | +<span class="gp">>>> </span><span class="n">discard_all</span><span class="p">()</span>
 | 
	
		
			
				|  |  | +<span class="go">1753</span>
 | 
	
		
			
				|  |  | +</pre></div>
 | 
	
		
			
				|  |  | +</div>
 | 
	
		
			
				|  |  | +<p>The number <tt class="docutils literal"><span class="pre">1753</span></tt> is the number of messages deleted.</p>
 | 
	
		
			
				|  |  | +<p>You can also start celeryd with the <tt class="docutils literal"><span class="pre">--discard</span></tt> argument which will
 | 
	
		
			
				|  |  | +accomplish the same thing.</p>
 | 
	
		
			
				|  |  | +</div>
 | 
	
		
			
				|  |  | +<div class="section" id="i-ve-discarded-messages-but-there-are-still-messages-left-in-the-queue">
 | 
	
		
			
				|  |  | +<h3>I’ve discarded messages, but there are still messages left in the queue?<a class="headerlink" href="#i-ve-discarded-messages-but-there-are-still-messages-left-in-the-queue" title="Permalink to this headline">¶</a></h3>
 | 
	
		
			
				|  |  | +<p><strong>Answer:</strong> Tasks are acknowledged (removed from the queue) as soon
 | 
	
		
			
				|  |  | +as they are actually executed. After the worker has received a task, it will
 | 
	
		
			
				|  |  | +take some time until it is actually executed, especially if there are a lot
 | 
	
		
			
				|  |  | +of tasks already waiting for execution. Messages that are not acknowledged are
 | 
	
		
			
				|  |  | +hold on to by the worker until it closes the connection to the broker (AMQP
 | 
	
		
			
				|  |  | +server). When that connection is closed (e.g because the worker was stopped)
 | 
	
		
			
				|  |  | +the tasks will be re-sent by the broker to the next available worker (or the
 | 
	
		
			
				|  |  | +same worker when it has been restarted), so to properly purge the queue of
 | 
	
		
			
				|  |  | +waiting tasks you have to stop all the workers, and then discard the tasks
 | 
	
		
			
				|  |  | +using <tt class="docutils literal"><span class="pre">discard_all</span></tt>.</p>
 | 
	
		
			
				|  |  |  </div>
 | 
	
		
			
				|  |  |  <div class="section" id="can-i-send-some-tasks-to-only-some-servers">
 | 
	
		
			
				|  |  |  <h3>Can I send some tasks to only some servers?<a class="headerlink" href="#can-i-send-some-tasks-to-only-some-servers" title="Permalink to this headline">¶</a></h3>
 | 
	
		
			
				|  |  | -<p>As of now there is only one use-case that works like this, and that is
 | 
	
		
			
				|  |  | -tasks of type <tt class="docutils literal"><span class="pre">A</span></tt> can be sent to servers <tt class="docutils literal"><span class="pre">x</span></tt> and <tt class="docutils literal"><span class="pre">y</span></tt>, while tasks
 | 
	
		
			
				|  |  | -of type <tt class="docutils literal"><span class="pre">B</span></tt> can be sent to server <tt class="docutils literal"><span class="pre">z</span></tt>. One server can’t handle more than
 | 
	
		
			
				|  |  | -one routing_key, but this is coming in a later release.</p>
 | 
	
		
			
				|  |  | +<p><strong>Answer:</strong> As of now there is only one use-case that works like this,
 | 
	
		
			
				|  |  | +and that is tasks of type <tt class="docutils literal"><span class="pre">A</span></tt> can be sent to servers <tt class="docutils literal"><span class="pre">x</span></tt> and <tt class="docutils literal"><span class="pre">y</span></tt>,
 | 
	
		
			
				|  |  | +while tasks of type <tt class="docutils literal"><span class="pre">B</span></tt> can be sent to server <tt class="docutils literal"><span class="pre">z</span></tt>. One server can’t
 | 
	
		
			
				|  |  | +handle more than one routing_key, but this is coming in a later release.</p>
 | 
	
		
			
				|  |  |  <p>Say you have two servers, <tt class="docutils literal"><span class="pre">x</span></tt>, and <tt class="docutils literal"><span class="pre">y</span></tt> that handles regular tasks,
 | 
	
		
			
				|  |  |  and one server <tt class="docutils literal"><span class="pre">z</span></tt>, that only handles feed related tasks, you can use this
 | 
	
		
			
				|  |  |  configuration:</p>
 | 
	
	
		
			
				|  | @@ -177,6 +202,8 @@ configuration:</p>
 | 
	
		
			
				|  |  |  <li><a class="reference external" href="#i-m-having-integrityerror-duplicate-key-errors-why">I’m having <tt class="docutils literal"><span class="pre">IntegrityError:</span> <span class="pre">Duplicate</span> <span class="pre">Key</span></tt> errors. Why?</a></li>
 | 
	
		
			
				|  |  |  <li><a class="reference external" href="#why-won-t-my-task-run">Why won’t my Task run?</a></li>
 | 
	
		
			
				|  |  |  <li><a class="reference external" href="#why-won-t-my-periodic-task-run">Why won’t my Periodic Task run?</a></li>
 | 
	
		
			
				|  |  | +<li><a class="reference external" href="#how-do-i-discard-all-waiting-tasks">How do I discard all waiting tasks?</a></li>
 | 
	
		
			
				|  |  | +<li><a class="reference external" href="#i-ve-discarded-messages-but-there-are-still-messages-left-in-the-queue">I’ve discarded messages, but there are still messages left in the queue?</a></li>
 | 
	
		
			
				|  |  |  <li><a class="reference external" href="#can-i-send-some-tasks-to-only-some-servers">Can I send some tasks to only some servers?</a></li>
 | 
	
		
			
				|  |  |  </ul>
 | 
	
		
			
				|  |  |  </li>
 | 
	
	
		
			
				|  | @@ -227,12 +254,12 @@ configuration:</p>
 | 
	
		
			
				|  |  |          <li class="right" >
 | 
	
		
			
				|  |  |            <a href="introduction.html" title="celery - Distributed Task Queue for Django."
 | 
	
		
			
				|  |  |               >previous</a> |</li>
 | 
	
		
			
				|  |  | -        <li><a href="index.html">Celery v0.4.1 (stable) documentation</a> »</li> 
 | 
	
		
			
				|  |  | +        <li><a href="index.html">Celery v0.4.2 (stable) documentation</a> »</li> 
 | 
	
		
			
				|  |  |        </ul>
 | 
	
		
			
				|  |  |      </div>
 | 
	
		
			
				|  |  |      <div class="footer">
 | 
	
		
			
				|  |  |        © Copyright 2009, Ask Solem.
 | 
	
		
			
				|  |  | -      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.2.
 | 
	
		
			
				|  |  | +      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.1.
 | 
	
		
			
				|  |  |      </div>
 | 
	
		
			
				|  |  |    </body>
 | 
	
		
			
				|  |  |  </html>
 |