RestartCommand.php 743B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. namespace Illuminate\Queue\Console;
  3. use Illuminate\Console\Command;
  4. use Illuminate\Support\InteractsWithTime;
  5. class RestartCommand extends Command
  6. {
  7. use InteractsWithTime;
  8. /**
  9. * The console command name.
  10. *
  11. * @var string
  12. */
  13. protected $name = 'queue:restart';
  14. /**
  15. * The console command description.
  16. *
  17. * @var string
  18. */
  19. protected $description = 'Restart queue worker daemons after their current job';
  20. /**
  21. * Execute the console command.
  22. *
  23. * @return void
  24. */
  25. public function handle()
  26. {
  27. $this->laravel['cache']->forever('illuminate:queue:restart', $this->currentTime());
  28. $this->info('Broadcasting queue restart signal.');
  29. }
  30. }