mirror of
https://github.com/netbox-community/netbox.git
synced 2025-07-14 09:51:22 -06:00
Add job timeout handling in JobRunner for periodic jobs
This commit is contained in:
parent
aa3f4cb5f5
commit
e8e95f5e97
@ -68,6 +68,8 @@ class JobRunner(ABC):
|
|||||||
finally:
|
finally:
|
||||||
if job.interval:
|
if job.interval:
|
||||||
new_scheduled_time = (job.scheduled or job.started) + timedelta(minutes=job.interval)
|
new_scheduled_time = (job.scheduled or job.started) + timedelta(minutes=job.interval)
|
||||||
|
if job.object and getattr(job.object, "python_class", None):
|
||||||
|
kwargs["job_timeout"] = job.object.python_class.job_timeout
|
||||||
cls.enqueue(
|
cls.enqueue(
|
||||||
instance=job.object,
|
instance=job.object,
|
||||||
user=job.user,
|
user=job.user,
|
||||||
|
Loading…
Reference in New Issue
Block a user