-
Notifications
You must be signed in to change notification settings - Fork 253
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
Spike: Offer simple ORM interface for scheduling a job #1292
Comments
@lampwins/whoever resolves this issue, would you also be able to consider a pattern where JobResult.enqueue_job() is triggered by django signals. |
Converting this to a spike with the goal of defining what the interface for a combined enqueue/scheduling method would look like. |
That should be covered by the work for #1631 |
Environment
Proposed Functionality
As P.D. the plugin developer, I want a simple interface to schedule a job execution via the ORM so that I can easily perform this action within the business logic of my plugin.
Use Case
Today it takes ~30 lines of code to create a
ScheduledJob
instance for a nautobot job. Example:nautobot/nautobot/extras/views.py
Lines 820 to 857 in 0e491e1
In the spirit of
JobResult.enqueue_job()
, it should not be this hard to schedule a job for execution. We can likely consolidate theJobResult.enqueue_job()
method into this too.Should have this interface live on
Job
(ex:Job.schedule_job()
) with the hope of collapsingJobResult.enqueue_job()
ontoJob
somewhere in the future.Database Changes
None
External Dependencies
None
TODO:
This should cover interfaces for both scheduled jobs and immediate execution.
The text was updated successfully, but these errors were encountered: