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

15692: Introduce background jobs #16699

Draft
wants to merge 4 commits into
base: feature
Choose a base branch
from

Conversation

alehaa
Copy link
Contributor

@alehaa alehaa commented Jun 24, 2024

Fixes: #15692

This PR includes a new BackgroundJob class to be used in NetBox and by NetBox plugins. It handles the necessary logic for starting and stopping jobs, including exception handling and rescheduling of recurring jobs.

This PR also implements the use of this framework for existing data source and script jobs, eliminating duplicate code and ensuring consistency.

A new abstract class can be used to implement job function classes. It
handles the necessary logic for starting and stopping jobs, including
exception handling and rescheduling of recurring jobs.

This commit also includes the migration of data source jobs to the new
framework.
Using the 'import_string()' utility from Django allows the job script
class to be simplified, as module imports no longer need to avoid loops.
This should make it easier to queue and maintain jobs.
Instead of maintaining two separate job execution logics, the same job
is now used for both background and interactive execution.
The independent implementations of interactive and background script
execution have been merged into a single BackgroundJob implementation.
@jeremystretch jeremystretch added this to the v4.1 milestone Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants