BaseLoop different logger

This commit is contained in:
Juan Pablo Vial
2025-05-16 12:54:52 -04:00
parent 8ca68bf7e8
commit f47f86dd2b
4 changed files with 33 additions and 5 deletions

View File

@ -44,10 +44,6 @@ class BaseLoop extends Console\Command\Command
}
$nextMinute = new DateTimeImmutable($start->format('Y-m-d H:i:00'));
$nextMinute = $nextMinute->add(new \DateInterval('PT1M'));
$this->logger->debug('Wait', [
'start' => $start->format('Y-m-d H:i:s.u'),
'nextMinute' => $nextMinute->format('Y-m-d H:i:s.u'),
]);
$diff = $nextMinute->getTimestamp() - $start->getTimestamp();
if ($diff > 0) {
$this->logger->debug("Waiting {$diff} seconds...");
@ -66,6 +62,7 @@ class BaseLoop extends Console\Command\Command
'command' => $commandName
]);
try {
$this->logger->notice("Running commnand: {$commandName}");
return $this->getApplication()->doRun($cmd, $output);
} catch (Throwable $exception) {
$this->logger->warning($exception);