Wait for execution
This commit is contained in:
@ -35,9 +35,10 @@ class BaseLoop extends Console\Command\Command
|
||||
|
||||
$output->writeln('Starting loop...');
|
||||
while (true) {
|
||||
$commands = $this->scheduleService->run();
|
||||
$commands = $this->scheduleService->getPending();
|
||||
foreach ($commands as $command) {
|
||||
$this->runCommand($input, $output, $command);
|
||||
sleep(10);
|
||||
}
|
||||
}
|
||||
return self::SUCCESS;
|
||||
|
@ -12,7 +12,7 @@ class Schedule
|
||||
|
||||
protected string $filename = '/var/spool/cron/crontabs/root';
|
||||
|
||||
public function run(): array
|
||||
public function getPending(): array
|
||||
{
|
||||
$now = new DateTimeImmutable();
|
||||
$schedule = $this->getCommandList();
|
||||
|
Reference in New Issue
Block a user