mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 01:41:22 -06:00
16927: Move JobRunner from utilities to netbox
This commit is contained in:
parent
8e6987edbf
commit
80fc9abb03
@ -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):
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user