diff --git a/docs/plugins/development/background-jobs.md b/docs/plugins/development/background-jobs.md index 81043526814..873390a5886 100644 --- a/docs/plugins/development/background-jobs.md +++ b/docs/plugins/development/background-jobs.md @@ -10,12 +10,12 @@ For example, your plugin might need to fetch data from a remote system. Dependin A background job implements a basic [Job](../../models/core/job.md) executor for all kinds of tasks. It has logic implemented to handle the management of the associated job object, rescheduling of periodic jobs in the given interval and error handling. Adding custom jobs is done by subclassing NetBox's `JobRunner` class. -::: utilities.jobs.JobRunner +::: netbox.jobs.JobRunner #### Example ```python title="jobs.py" -from utilities.jobs import JobRunner +from netbox.jobs import JobRunner class MyTestJob(JobRunner): @@ -47,7 +47,7 @@ As described above, jobs can be scheduled for immediate execution or at any late #### Example ```python title="jobs.py" -from utilities.jobs import JobRunner +from netbox.jobs import JobRunner class MyHousekeepingJob(JobRunner): diff --git a/netbox/core/jobs.py b/netbox/core/jobs.py index 1c38cf61f0f..d2b84639870 100644 --- a/netbox/core/jobs.py +++ b/netbox/core/jobs.py @@ -1,7 +1,7 @@ import logging +from netbox.jobs import JobRunner from netbox.search.backends import search_backend -from utilities.jobs import JobRunner from .choices import DataSourceStatusChoices from .exceptions import SyncError from .models import DataSource diff --git a/netbox/extras/jobs.py b/netbox/extras/jobs.py index 2529e9d2b0a..e540ef4398a 100644 --- a/netbox/extras/jobs.py +++ b/netbox/extras/jobs.py @@ -8,8 +8,8 @@ from django.utils.translation import gettext as _ from core.signals import clear_events from extras.models import Script as ScriptModel from netbox.context_managers import event_tracking +from netbox.jobs import JobRunner from utilities.exceptions import AbortScript, AbortTransaction -from utilities.jobs import JobRunner from .utils import is_report diff --git a/netbox/utilities/jobs.py b/netbox/netbox/jobs.py similarity index 100% rename from netbox/utilities/jobs.py rename to netbox/netbox/jobs.py diff --git a/netbox/utilities/tests/test_jobs.py b/netbox/netbox/tests/test_jobs.py similarity index 100% rename from netbox/utilities/tests/test_jobs.py rename to netbox/netbox/tests/test_jobs.py