2025-05-10 12:40:06 -04:00
|
|
|
<?php
|
|
|
|
namespace Incoviba\Command;
|
|
|
|
|
2025-05-13 15:49:41 -04:00
|
|
|
use DateTimeImmutable;
|
2025-05-10 12:40:06 -04:00
|
|
|
use Symfony\Component\Console;
|
|
|
|
use Incoviba\Common\Alias\Command;
|
|
|
|
|
|
|
|
#[Console\Attribute\AsCommand(
|
|
|
|
name: 'queue',
|
|
|
|
description: 'Run queue'
|
|
|
|
)]
|
|
|
|
class Queue extends Command
|
|
|
|
{
|
|
|
|
public function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output): int
|
|
|
|
{
|
|
|
|
$this->logger->debug("Running {$this->getName()}");
|
|
|
|
$io = new Console\Style\SymfonyStyle($input, $output);
|
2025-05-13 15:40:32 -04:00
|
|
|
$now = new DateTimeImmutable();
|
|
|
|
$io->title("[{$now->format('Y-m-d H:i:s e')}] Running Queue...");
|
2025-05-10 12:40:06 -04:00
|
|
|
|
|
|
|
$uri = '/api/queue/run';
|
|
|
|
$output->writeln("GET {$uri}");
|
|
|
|
$response = $this->client->get($uri);
|
|
|
|
$output->writeln("Response Code: {$response->getStatusCode()}");
|
|
|
|
|
|
|
|
return Console\Command\Command::SUCCESS;
|
|
|
|
}
|
|
|
|
}
|