Skip to content

Remove unused interval option from occ background-job:worker #53414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

salmart-dev
Copy link
Contributor

@salmart-dev salmart-dev commented Jun 10, 2025

Summary

Context

This PR comes from an investigation done for issue #49584

The user reported that running occ background-job:worker --interval 5 does not run jobs every 5 seconds as advertised.
Upon investigation, I found out that the implementation for the --interval option was never merged and the option seems to be a leftover from the PR where background workers were introduced.

This PR removes the --interval option from occ background-job:worker to avoid confusion.

Checklist

@salmart-dev salmart-dev force-pushed the fix/49584-background-worker-remove-interval branch from 83ada4d to 1086aa2 Compare June 10, 2025 09:34
@salmart-dev salmart-dev self-assigned this Jun 10, 2025
@salmart-dev salmart-dev changed the title Remove unused interval option Remove unused interval option from occ background-job:worker Jun 10, 2025
@salmart-dev salmart-dev added the 3. to review Waiting for reviews label Jun 10, 2025
@salmart-dev salmart-dev marked this pull request as ready for review June 10, 2025 10:51
@salmart-dev salmart-dev requested a review from a team as a code owner June 10, 2025 10:51
@salmart-dev salmart-dev requested review from nfebe, yemkareems and sorbaugh and removed request for a team June 10, 2025 10:51
@come-nc come-nc added this to the Nextcloud 32 milestone Jun 10, 2025
@salmart-dev
Copy link
Contributor Author

/backport to stable31

@salmart-dev
Copy link
Contributor Author

/backport to stable30

@salmart-dev salmart-dev force-pushed the fix/49584-background-worker-remove-interval branch 3 times, most recently from 1013a8c to 8bebe19 Compare June 23, 2025 09:55
Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaking change

Copy link
Contributor

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

@salmart-dev salmart-dev force-pushed the fix/49584-background-worker-remove-interval branch from 8bebe19 to 82027f4 Compare June 30, 2025 10:11
@salmart-dev salmart-dev force-pushed the fix/49584-background-worker-remove-interval branch from 82027f4 to 0b390e3 Compare June 30, 2025 10:11
@@ -115,10 +115,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$output->writeln('Waiting for new jobs to be queued', OutputInterface::VERBOSITY_VERBOSE);
// Re-check interval for new jobs
sleep(1);
sleep($input->getOption('interval'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sleep($input->getOption('interval'));
if ((int)$input->getOption('interval') === 0) {
break;
}
sleep((int)$input->getOption('interval'));

@@ -49,8 +49,8 @@ protected function configure(): void {
'interval',
'i',
InputOption::VALUE_OPTIONAL,
'Interval in seconds in which the worker should repeat already processed jobs (set to 0 for no repeat)',
5
'Interval in seconds in which the worker should repeat already processed jobs',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
'Interval in seconds in which the worker should repeat already processed jobs',
'Interval in seconds in which the worker should repeat already processed jobs (set to 0 for no repeat)',

continue;
}

$output->writeln('<comment>Job ' . $job::class . ' is a TimedJob, this command is designed to run QueuedJob.</comment>');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$output->writeln('<comment>Job ' . $job::class . ' is a TimedJob, this command is designed to run QueuedJob.</comment>');

wrong place and unrelated?

@salmart-dev salmart-dev added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants