Skip to content

Commit

Permalink
Rename to clear-queues instead of clear-all-queues
Browse files Browse the repository at this point in the history
  • Loading branch information
sander-beenen committed Nov 22, 2024
1 parent 912af86 commit 6776720
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Illuminate\Notifications\NotificationServiceProvider;
use Laravel\Horizon\Horizon;
use System\Classes\PluginBase;
use Vdlp\Horizon\Console\ClearAllQueuesCommand;
use Vdlp\Horizon\Console\ClearQueuesCommand;
use Vdlp\Horizon\Console\InstallCommand;
use Vdlp\Horizon\Console\PushExampleJobsCommand;
use Vdlp\Horizon\ServiceProviders\HorizonServiceProvider;
Expand Down Expand Up @@ -50,7 +50,7 @@ public function boot(): void
$this->registerConsoleCommand(PushExampleJobsCommand::class, PushExampleJobsCommand::class);
}

$this->registerConsoleCommand(ClearAllQueuesCommand::class, ClearAllQueuesCommand::class);
$this->registerConsoleCommand(ClearQueuesCommand::class, ClearQueuesCommand::class);
$this->registerConsoleCommand(InstallCommand::class, InstallCommand::class);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
use Illuminate\Console\Command;
use Illuminate\Contracts\Config\Repository;

final class ClearAllQueuesCommand extends Command
final class ClearQueuesCommand extends Command
{
public function __construct()
{
$this->name = 'vdlp:horizon:clear-queues';
$this->description = 'Clears all the queues with one command';
$this->description = 'Clears all the Horizon queues with one command.';

parent::__construct();
}
Expand All @@ -25,8 +25,9 @@ public function handle(Repository $config): void
foreach ($supervisors as $supervisor) {
foreach ($supervisor['queue'] as $queue) {
Artisan::call('horizon:clear', ['--queue' => $queue]);

$this->comment(preg_replace('/\R+/', ' ', Artisan::output()));
}
}
}
}
}

0 comments on commit 6776720

Please sign in to comment.