Skip to content
This repository has been archived by the owner on May 20, 2024. It is now read-only.

Commit

Permalink
Makes sure metrics are displayed with failed jobs activated
Browse files Browse the repository at this point in the history
  • Loading branch information
nunomaduro committed Sep 14, 2020
1 parent 7ae9fbf commit 58547b5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Repositories/JobsMetricsRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Aws\CloudWatch\CloudWatchClient;
use Aws\Sqs\SqsClient;
use Illuminate\Database\QueryException;
use Illuminate\Queue\Failed\FailedJobProviderInterface;
use Illuminate\Support\Carbon;
use Laravel\VaporUi\Support\Cloud;
Expand Down Expand Up @@ -218,7 +219,11 @@ public function processedAverageByHoursAgo($fromHoursAgo, $untilHoursAgo)
protected function failedJobs()
{
if ($this->failedJobsCollection === null) {
$this->failedJobsCollection = collect($this->failedJobs->all());
try {
$this->failedJobsCollection = collect($this->failedJobs->all());
} catch (QueryException $e) {
$this->failedJobsCollection = collect();
}
}

return $this->failedJobsCollection;
Expand Down

0 comments on commit 58547b5

Please sign in to comment.