FIX: esperar al siguiente minuto
This commit is contained in:
@ -40,7 +40,11 @@ class BaseLoop extends Console\Command\Command
|
||||
// wait for next minute
|
||||
$now = new DateTimeImmutable();
|
||||
$nextMinute = new DateTimeImmutable($now->format('Y-m-d H:i:00'));
|
||||
$nextMinute->add(new \DateInterval('PT1M'));
|
||||
$nextMinute = $nextMinute->add(new \DateInterval('PT1M'));
|
||||
$this->logger->debug('Wait', [
|
||||
'now' => $now->format('Y-m-d H:i:s.u'),
|
||||
'nextMinute' => $nextMinute->format('Y-m-d H:i:s.u'),
|
||||
]);
|
||||
$diff = $nextMinute->getTimestamp() - $now->getTimestamp();
|
||||
if ($diff > 0) {
|
||||
$output->writeln("Waiting {$diff} seconds...");
|
||||
|
Reference in New Issue
Block a user