title: How to flush tasks with countdown timers from celery queue
body: <p>My Celery queue has hundreds of tasks with countdowns that will make them trigger over the next few hours. Is there a way to have these tasks run immediately such that the queue is effectively flushed? </p>
  
  <p>I'm currently planning an upgrade to our server and I want to make sure that there are no background tasks running while the upgrade completes. If I have to wait for these countdowns, that's OK, but I'd rather force the tasks to run instead.</p>
  
  <p>Another option could be to pause processing of the queue until the upgrade is complete, but flushing seems like a better option.</p>
  
  <p><strong><em>EDIT</em></strong>: I've figured out how to find a list of tasks that are scheduled:</p>
  
  <pre><code>from celery.task.control import inspect
  i = inspect()
  tasks = i.scheduled()
  </code></pre>
  
  <p>Now I just need to sort out how to force their execution.</p>