title: How to restart supervisor for a Laravel deployment?
body: <p>I currently use a cron job to call <code>php artisan queue:work --once</code> every minute to work on my jobs queue in production.</p>
  <p>I would like to use supervisor instead to handle my queues.</p>
  <p>In the docs in the section of <a href="https://laravel.com/docs/queues#supervisor-configuration" rel="nofollow noreferrer">supervisor-configuration</a> it states:</p>
  <blockquote>
  <p>Since queue workers are long-lived processes, they will not pick up changes to your code without being restarted. So, the simplest way to deploy an application using queue workers is to restart the workers during your deployment process. You may gracefully restart all of the workers by issuing the queue:restart command:</p>
  </blockquote>
  <pre><code>php artisan queue:restart
  </code></pre>
  <blockquote>
  <p>This command will instruct all queue workers to gracefully &quot;die&quot; after they finish processing their current job so that no existing jobs are lost. <strong>Since the queue workers will die when the queue:restart command is executed, you should be running a process manager such as Supervisor to automatically restart the queue workers.</strong></p>
  </blockquote>
  <p>I don't understsand the last sentence. So lets say I have installed and configured the supervisor as described  <a href="https://laravel.com/docs/7.x/queues#supervisor-configuration" rel="nofollow noreferrer">here</a> and I manually logged into the server through ssh and started supervisor:</p>
  <pre><code>sudo supervisorctl start laravel-worker:*
  </code></pre>
  <p>Do I need to call <code>php artisan queue:restart</code> on deployment? If so, then this will only kill all current workers, how do I tell supervisor to restart the queue workers? Do I need to call <code>sudo supervisorctl restart laravel-worker:*</code> in the deployment after <code>php artisan queue:restart</code>?</p>