diff --git a/src/Console/ClearCommand.php b/src/Console/ClearCommand.php index a2ebfb10..e3b79c00 100644 --- a/src/Console/ClearCommand.php +++ b/src/Console/ClearCommand.php @@ -21,6 +21,7 @@ class ClearCommand extends Command * @var string */ protected $signature = 'horizon:clear + {connection? : The name of the queue connection} {--queue= : The name of the queue to clear} {--force : Force the operation to run when in production}'; @@ -48,7 +49,8 @@ public function handle(JobRepository $jobRepository, QueueManager $manager) return 1; } - $connection = Arr::first($this->laravel['config']->get('horizon.defaults'))['connection'] ?? 'redis'; + $connection = $this->argument('connection') + ?: Arr::first($this->laravel['config']->get('horizon.defaults'))['connection'] ?? 'redis'; if (method_exists($jobRepository, 'purge')) { $jobRepository->purge($queue = $this->getQueue($connection));