title: Laravel 5.3 queue worker, stop after some time through Jenkins
body: <p>In Laravel 5.3.</p>
  
  <p>I'm running through jenkin a command of laravel:</p>
  
  <pre><code>php artisan queue:work
  </code></pre>
  
  <p>But I need to stop it. Ideally I would like to stop the worker after the queue jobs gets empty, but it's not possible on Laravel 5.3. So another option would be to stop the command after sometime, let's say 1 minute.</p>
  
  <p>How can I stop a process running through jenkins after some time? or stop a php artisan command.</p>
  
  <p>With <code>php artisan queue:restart</code> I can stop all the jobs so I tried:</p>
  
  <pre><code>php artisan queue:work
  sleep 60; php artisan queue:restart
  </code></pre>
  
  <p>But that 2nd line will never get reached because the workers is still running.</p>
  
  <p>Any tip?</p>