Skip to content
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

perf(cron): Delay (re)checking timed jobs #50768

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ChristophWurst
Copy link
Member

  • Resolves: #

Summary

Right now timed jobs are always loaded from the db and instantiated. Jobs with intervals higher than the cron interval are continuously loaded and checked, \OCP\BackgroundJob\TimedJob::start prevents the actual execution.
As an optimization we can preemptively check if a job is ready. Otherwise we park it for a later check.

How to test

  1. Set breakpoints in timed jobs constructors
  2. Observe how the jobs are instantiated once for the initial check and only every instantiated again when they are ready or two days have passed.

TODO

  • Make the changes
  • Manually test the changes
    • Jobs that are ready are executed like before
    • Jobs are parked as expected
    • Once the parked timestamp elapsed, jobs run again like before

Checklist

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant