diff --git a/app/Console/Commands/ResetQueueStatus.php b/app/Console/Commands/ResetQueueStatus.php new file mode 100644 index 0000000..027585c --- /dev/null +++ b/app/Console/Commands/ResetQueueStatus.php @@ -0,0 +1,66 @@ +clearer = $clearer; + parent::__construct(); + } + + /** + * Execute the console command. + * + * @return mixed + */ + public function handle() + { + Website::query()->update([ + 'in_queue_og' => 0, + 'in_queue_robots' => 0, + 'in_queue_ssl' => 0, + 'in_queue_crawler' => 0, + 'in_queue_dns' => 0, + 'in_queue_uptime' => 0, + ]); + + $cleared = $this->clearer->clear('redis', 'default'); + $this->info(sprintf('Cleared %d jobs on "default"', $cleared)); + + $cleared = $this->clearer->clear('redis', 'default_long'); + $this->info(sprintf('Cleared %d jobs on "default_long"', $cleared)); + + $this->info('Queue statuses all reset!'); + $this->call('queue:flush'); + } +} diff --git a/composer.json b/composer.json index eb34ea1..0bfe766 100644 --- a/composer.json +++ b/composer.json @@ -18,6 +18,7 @@ "laravel/horizon": "^3.3", "laravel/tinker": "^1.0", "maelstrom-cms/toolkit": "^1.0", + "morrislaptop/laravel-queue-clear": "^1.2", "owenmelbz/domain-enforcement": "^0.0.6", "predis/predis": "^1.1", "sebastian/diff": "^3.0", diff --git a/composer.lock b/composer.lock index c15d267..1d305e0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "068d1e8a6fbbaf463aa86dabd857fa02", + "content-hash": "9ec3f7e5d03429df853ccf468669b5af", "packages": [ { "name": "cakephp/chronos", @@ -1824,6 +1824,47 @@ ], "time": "2019-12-20T14:15:16+00:00" }, + { + "name": "morrislaptop/laravel-queue-clear", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/morrislaptop/laravel-queue-clear.git", + "reference": "58c8b64e0f6e9f190fa687b8e44b442a649cbc98" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/morrislaptop/laravel-queue-clear/zipball/58c8b64e0f6e9f190fa687b8e44b442a649cbc98", + "reference": "58c8b64e0f6e9f190fa687b8e44b442a649cbc98", + "shasum": "" + }, + "require": { + "illuminate/support": ">=5.0.0", + "php": ">=5.4.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Morrislaptop\\LaravelQueueClear\\LaravelQueueClearServiceProvider" + ] + } + }, + "autoload": { + "psr-4": { + "Morrislaptop\\LaravelQueueClear\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "authors": [ + { + "name": "Craig Morris", + "email": "craig.michael.morris@gmail.com" + } + ], + "description": "Command for wiping your queues clear", + "time": "2019-08-05T15:21:24+00:00" + }, { "name": "nesbot/carbon", "version": "2.34.0",