re-start celery queue after re-starting broker
<p>I started my celery worker queue (in background):</p>

<pre><code>celery worker -Q my_queue -l info
</code></pre>

<p>After this, its broker (<code>redis</code>) was stopped, and meanwhile the background <code>celery worker</code> keeps trying to re-connect to redis after <strong>growing amount of time</strong>.</p>

<p>Now my goal is re-start a <strong>non-duplicate</strong> <code>my_queue</code> after restarting redis. I realize that the following celery API will not return <code>my_queue</code> until the re-connection is made:</p>

<pre><code>celery.task.control.inspect().active_queues()
</code></pre>

<p>Now if I start a new <code>my_queue</code>, I will end up with duplicate <code>my_queue</code> if the previous <code>celery worker</code> in the background is re-connected afterward.</p>

<p>A solution might be letting <code>celery worker</code> to actively quit if its broker is found stopped, but I don't find the right way to do this. I also don't want to kill it by previous-saved PID. Any suggestions or alternatives will be appreciated.</p>