ForgetFailedCommand.php 771B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace Illuminate\Queue\Console;
  3. use Illuminate\Console\Command;
  4. class ForgetFailedCommand extends Command
  5. {
  6. /**
  7. * The console command signature.
  8. *
  9. * @var string
  10. */
  11. protected $signature = 'queue:forget {id : The ID of the failed job.}';
  12. /**
  13. * The console command description.
  14. *
  15. * @var string
  16. */
  17. protected $description = 'Delete a failed queue job';
  18. /**
  19. * Execute the console command.
  20. *
  21. * @return void
  22. */
  23. public function handle()
  24. {
  25. if ($this->laravel['queue.failer']->forget($this->argument('id'))) {
  26. $this->info('Failed job deleted successfully!');
  27. } else {
  28. $this->error('No failed job matches the given ID.');
  29. }
  30. }
  31. }