diff --git a/src/Commands/Discover.php b/src/Commands/Discover.php index 7d7e556..1f7686a 100644 --- a/src/Commands/Discover.php +++ b/src/Commands/Discover.php @@ -15,6 +15,7 @@ namespace FastyBird\Connector\NsPanel\Commands; +use DateTimeImmutable; use DateTimeInterface; use FastyBird\Connector\NsPanel\Documents; use FastyBird\Connector\NsPanel\Exceptions; @@ -117,6 +118,10 @@ protected function execute(Input\InputInterface $input, Output\OutputInterface $ return Console\Command\Command::FAILURE; } + $executedTime = $this->clock->getNow(); + assert($executedTime instanceof DateTimeImmutable); + $this->executedTime = $executedTime->modify('-5 second'); + $io = new Style\SymfonyStyle($input, $output); $io->title((string) $this->translator->translate('//ns-panel-connector.cmd.discover.title')); @@ -295,8 +300,6 @@ function (string|int|null $answer) use ($connectors): Documents\Connectors\Conne $io->info((string) $this->translator->translate('//ns-panel-connector.cmd.discover.messages.starting')); - $this->executedTime = $this->clock->getNow(); - $serviceCmd = $symfonyApp->find(DevicesCommands\Connector::NAME); $result = $serviceCmd->run(new Input\ArrayInput([ diff --git a/src/Commands/Install.php b/src/Commands/Install.php index 2fa42a6..7202fec 100644 --- a/src/Commands/Install.php +++ b/src/Commands/Install.php @@ -16,6 +16,7 @@ namespace FastyBird\Connector\NsPanel\Commands; use Brick\Math; +use DateTimeImmutable; use DateTimeInterface; use Doctrine\DBAL; use Exception; @@ -1271,6 +1272,8 @@ private function discoverDevices(Style\SymfonyStyle $io, Entities\Connectors\Con } $executedTime = $this->clock->getNow(); + assert($executedTime instanceof DateTimeImmutable); + $executedTime = $executedTime->modify('-5 second'); $symfonyApp = $this->getApplication();