2021-05-20 23:54:07 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Console\Cron;
|
|
|
|
|
2022-02-12 05:24:06 +08:00
|
|
|
use App\Contracts\CronCommand;
|
2021-05-20 23:54:07 +08:00
|
|
|
use Illuminate\Support\Facades\Artisan;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This just calls the CronHourly event, so all of the
|
|
|
|
* listeners, etc can just be called to run those tasks
|
|
|
|
*/
|
2022-02-12 05:24:06 +08:00
|
|
|
class JobQueue extends CronCommand
|
2021-05-20 23:54:07 +08:00
|
|
|
{
|
|
|
|
protected $signature = 'cron:queue';
|
|
|
|
protected $description = 'Run the cron queue tasks';
|
|
|
|
protected $schedule;
|
|
|
|
|
|
|
|
public function handle(): void
|
|
|
|
{
|
2022-02-12 05:24:06 +08:00
|
|
|
$this->callEvent();
|
|
|
|
|
|
|
|
$queueOutput = trim(Artisan::output());
|
|
|
|
if (!empty($queueOutput)) {
|
|
|
|
$this->info($queueOutput);
|
|
|
|
}
|
|
|
|
}
|
2021-05-20 23:54:07 +08:00
|
|
|
|
2022-02-12 05:24:06 +08:00
|
|
|
public function callEvent()
|
|
|
|
{
|
|
|
|
Artisan::call('queue:cron');
|
2021-05-20 23:54:07 +08:00
|
|
|
}
|
|
|
|
}
|