From 43f2470f90e8d8415131a7b1f39c6301ae5bc0c3 Mon Sep 17 00:00:00 2001 From: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com> Date: Mon, 30 Jun 2025 11:35:14 +0200 Subject: [PATCH] fix: use interval value in JobWorker Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com> --- core/Command/Background/JobWorker.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/Command/Background/JobWorker.php b/core/Command/Background/JobWorker.php index a2da18440a2e6..723b7d32db22e 100644 --- a/core/Command/Background/JobWorker.php +++ b/core/Command/Background/JobWorker.php @@ -50,7 +50,7 @@ protected function configure(): void { 'i', InputOption::VALUE_OPTIONAL, 'Interval in seconds in which the worker should repeat already processed jobs (set to 0 for no repeat)', - 5 + 1 ) ->addOption( 'stop_after', @@ -114,8 +114,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int } $output->writeln('Waiting for new jobs to be queued', OutputInterface::VERBOSITY_VERBOSE); + if ((int)$input->getOption('interval') === 0) { + break; + } // Re-check interval for new jobs - sleep(1); + sleep((int)$input->getOption('interval')); continue; }