-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Closes #16971: Add system jobs #17716
Closes #16971: Add system jobs #17716
Conversation
@alehaa I think we might have jumped the gun a bit on FR #16971: Because this is introducing a new plugin capability, it needs to be tagged for a minor release. (We can't ship any changes to the plugins API in a patch release.) I have no issue tagging for v4.2 though. Are okay with rebasing this against the |
That's fine by me. Do you initiate the rebase or do I have to do it locally and submit a new PR? |
I should be able to tackle the rebase, just wanted to give you a heads up. |
bf88f18
to
5b61d14
Compare
5b61d14
to
191552f
Compare
191552f
to
3091fa5
Compare
If a job is to be enqueued once and no specific scheduled time is specified, any scheduled time of existing jobs will be valid. Only if a specific scheduled time is specified for 'enqueue_once()' can it be evaluated.
A new registry key allows background system jobs to be registered and automatically scheduled when rqworker starts.
The documentation reflected a non-production state of the JobRunner framework left over from development. Now a more practical example demonstrates the usage.
To clarify which meta-attributes belong to system jobs, each of them is now prefixed with 'system_'.
3091fa5
to
8a8c328
Compare
Previously, the 'system_enabled' attribute was used to control whether a job should run or not. However, this can also be accomplished by evaluating the job's interval.
Fixes: #16971
This PR allows the NetBox core and plugins to register job runners as system jobs. These are automatically scheduled without UI interaction, just before the worker process starts. This allows job runners to be used for housekeeping and synchronization tasks in future commits.