varioDelayedUpdate = $varioDelayedUpdate; } protected function execute(InputInterface $input, OutputInterface $output) { while (true) { sqlGetConnection()->connect(); $output->writeln('Processing batch of 100 items...'); $processed = $this->varioDelayedUpdate->processDelayedUpdate(100); if ($processed <= 0) { $output->writeln('Nothing to process, sleeping for 300 seconds...'); sqlGetConnection()->close(); sleep(300); } } } }