Merge pull request #57436 from nextcloud/backport/53414/stable31

[stable31] Fix interval option in `occ background-job:worker`
This commit is contained in:
Andy Scherzinger 2026-01-18 21:15:22 +01:00 committed by GitHub
commit da204c90a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -50,7 +50,7 @@ class JobWorker extends JobBase {
'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 @@ class JobWorker extends JobBase {
}
$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;
}