diff --git a/src/Console/ClearMetricsCommand.php b/src/Console/ClearMetricsCommand.php index 45057de7..799c4c3b 100644 --- a/src/Console/ClearMetricsCommand.php +++ b/src/Console/ClearMetricsCommand.php @@ -29,7 +29,7 @@ class ClearMetricsCommand extends Command */ public function handle(MetricsRepository $metrics) { - $metrics->reset(); + $metrics->clear(); $this->info('Metrics cleared successfully.'); } diff --git a/src/Repositories/RedisMetricsRepository.php b/src/Repositories/RedisMetricsRepository.php index 486ef276..ba0c635e 100644 --- a/src/Repositories/RedisMetricsRepository.php +++ b/src/Repositories/RedisMetricsRepository.php @@ -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);