Skip to content

Commit a018660

Browse files
salmart-devbackportbot[bot]
authored andcommitted
fix: use interval value in JobWorker
Signed-off-by: Salvatore Martire <4652631+salmart-dev@users.noreply.github.com>
1 parent c5d8175 commit a018660

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

core/Command/Background/JobWorker.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ protected function configure(): void {
5050
'i',
5151
InputOption::VALUE_OPTIONAL,
5252
'Interval in seconds in which the worker should repeat already processed jobs (set to 0 for no repeat)',
53-
5
53+
1
5454
)
5555
->addOption(
5656
'stop_after',
@@ -114,8 +114,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
114114
}
115115

116116
$output->writeln('Waiting for new jobs to be queued', OutputInterface::VERBOSITY_VERBOSE);
117+
if ((int)$input->getOption('interval') === 0) {
118+
break;
119+
}
117120
// Re-check interval for new jobs
118-
sleep(1);
121+
sleep((int)$input->getOption('interval'));
119122
continue;
120123
}
121124

0 commit comments

Comments
 (0)