Pending now in queue
This commit is contained in:
22
cli/src/Command/Queue/Pending.php
Normal file
22
cli/src/Command/Queue/Pending.php
Normal file
@ -0,0 +1,22 @@
|
||||
<?php
|
||||
namespace Incoviba\Command\Queue;
|
||||
|
||||
use Incoviba\Service;
|
||||
use Symfony\Component\Console;
|
||||
|
||||
#[Console\Attribute\AsCommand(name: 'queue:pending', description: 'List pending jobs in queue')]
|
||||
class Pending extends Console\Command\Command
|
||||
{
|
||||
public function __construct(protected Service\Job $jobService, ?string $name = null)
|
||||
{
|
||||
parent::__construct($name);
|
||||
}
|
||||
|
||||
protected function execute(Console\Input\InputInterface $input, Console\Output\OutputInterface $output): int
|
||||
{
|
||||
$jobCount = $this->jobService->getPending();
|
||||
$output->writeln("Found {$jobCount} pending jobs");
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user