Skip to content

Commit

Permalink
fix(clear-metrics): fixing the function name and when keys is null (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
joaopalopes24 committed Sep 19, 2023
1 parent 2d1662d commit ded3632
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Console/ClearMetricsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class ClearMetricsCommand extends Command
*/
public function handle(MetricsRepository $metrics)
{
$metrics->reset();
$metrics->clear();

$this->info('Metrics cleared successfully.');
}
Expand Down
2 changes: 1 addition & 1 deletion src/Repositories/RedisMetricsRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ public function clear()
$cursor, ['match' => config('horizon.prefix').$pattern]
);

foreach ($keys as $key) {
foreach ($keys ?? [] as $key) {
$this->forget(Str::after($key, config('horizon.prefix')));
}
} while ($cursor > 0);
Expand Down

0 comments on commit ded3632

Please sign in to comment.