phpvms/app/Console/Commands/ProcessQueue.php
Arthur Parienté 992b6d343a
[8.x] feature: upgrade to Laravel 13 (#2204)
* upgrade to laravel 13

* phpstan

* rollback to symfony 7.4

* fix: ModuleService merge

* refactor: new rector rules
2026-05-06 11:27:21 -05:00

44 lines
1.1 KiB
PHP

<?php
namespace App\Console\Commands;
use App;
use App\Contracts\Command;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Log;
class ProcessQueue extends Command
{
protected $signature = 'queue:cron';
protected $description = 'Process the queue from a cron job';
/**
* Run the queue tasks
*/
public function handle(): void
{
Artisan::call('queue:work', [
// '--sansdaemon' => null,
'--stop-when-empty' => null,
]);
$jobOutput = trim(Artisan::output());
if ($jobOutput !== '' && $jobOutput !== '0') {
Log::info($jobOutput);
}
// /** @var App\Support\WorkCommand $queueWorker */
// $queueWorker = new App\Support\WorkCommand(app('queue.worker'), app('cache.store'));
// $queueWorker->setInput($queueWorker->createInputFromArguments([]));
// $queueWorker->handle();
/*$output = $this->call('queue:work', [
'--stop-when-empty' => null,
]);
Log::info($output);*/
}
}