Wait for execution

This commit is contained in:
Juan Pablo Vial
2025-05-13 15:15:20 -04:00
parent b45d03aa7e
commit 6d1a1c914a
2 changed files with 3 additions and 2 deletions

View File

@ -35,9 +35,10 @@ class BaseLoop extends Console\Command\Command
$output->writeln('Starting loop...'); $output->writeln('Starting loop...');
while (true) { while (true) {
$commands = $this->scheduleService->run(); $commands = $this->scheduleService->getPending();
foreach ($commands as $command) { foreach ($commands as $command) {
$this->runCommand($input, $output, $command); $this->runCommand($input, $output, $command);
sleep(10);
} }
} }
return self::SUCCESS; return self::SUCCESS;

View File

@ -12,7 +12,7 @@ class Schedule
protected string $filename = '/var/spool/cron/crontabs/root'; protected string $filename = '/var/spool/cron/crontabs/root';
public function run(): array public function getPending(): array
{ {
$now = new DateTimeImmutable(); $now = new DateTimeImmutable();
$schedule = $this->getCommandList(); $schedule = $this->getCommandList();