Manejo de trabajos en cli por php en vez de cron
This commit is contained in:
26
cli/src/Command/Queue.php
Normal file
26
cli/src/Command/Queue.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace Incoviba\Command;
|
||||
|
||||
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);
|
||||
$io->title("Running Queue...");
|
||||
|
||||
$uri = '/api/queue/run';
|
||||
$output->writeln("GET {$uri}");
|
||||
$response = $this->client->get($uri);
|
||||
$output->writeln("Response Code: {$response->getStatusCode()}");
|
||||
|
||||
return Console\Command\Command::SUCCESS;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user