Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Apr 7, 2021
1 parent 3ccf3ef commit c351a30
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions src/Illuminate/Queue/Console/RetryCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,7 @@ protected function getJobIds()
}

if ($queue = $this->option('queue')) {
$ids = collect($this->laravel['queue.failer']->all())
->where('queue', $queue)
->pluck('id')
->toArray();

if (count($ids) === 0) {
$this->error("Unable to find failed jobs for queue [{$queue}].");
}

return $ids;
return $this->getJobIdsByQueue($queue);
}

if ($ranges = (array) $this->option('range')) {
Expand All @@ -83,6 +74,26 @@ protected function getJobIds()
return array_values(array_filter(array_unique($ids)));
}

/**
* Get the job IDs by queue, if applicable.
*
* @param string $queue
* @return array
*/
protected function getJobIdsByQueue($queue)
{
$ids = collect($this->laravel['queue.failer']->all())
->where('queue', $queue)
->pluck('id')
->toArray();

if (count($ids) === 0) {
$this->error("Unable to find failed jobs for queue [{$queue}].");
}

return $ids;
}

/**
* Get the job IDs ranges, if applicable.
*
Expand Down

0 comments on commit c351a30

Please sign in to comment.