Skip to content

Commit 07bc8aa

Browse files
Merge pull request #57435 from nextcloud/backport/53414/stable32
[stable32] Fix interval option in `occ background-job:worker`
2 parents e38c1eb + 3abd852 commit 07bc8aa

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

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)