Skip to content

Commit

Permalink
[10.x] Add exit code to queue:clear, and queue:forget commands
Browse files Browse the repository at this point in the history
  • Loading branch information
bytestream committed Jan 16, 2024
1 parent 8d4eaeb commit f820341
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Queue/Console/ClearCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ public function handle()
$this->components->info('Cleared '.$count.' '.Str::plural('job', $count).' from the ['.$queueName.'] queue');
} else {
$this->components->error('Clearing queues is not supported on ['.(new ReflectionClass($queue))->getShortName().']');
}

return 0;
return 1;
}
}

/**
Expand Down
4 changes: 3 additions & 1 deletion src/Illuminate/Queue/Console/ForgetFailedCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,16 @@ class ForgetFailedCommand extends Command
/**
* Execute the console command.
*
* @return void
* @return int|null
*/
public function handle()
{
if ($this->laravel['queue.failer']->forget($this->argument('id'))) {
$this->components->info('Failed job deleted successfully.');
} else {
$this->components->error('No failed job matches the given ID.');

return 1;
}
}
}

0 comments on commit f820341

Please sign in to comment.