Skip to content

Commit e8e95f5

Browse files
miaow2jeremystretch
authored andcommitted
Add job timeout handling in JobRunner for periodic jobs
1 parent aa3f4cb commit e8e95f5

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

netbox/netbox/jobs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ def handle(cls, job, *args, **kwargs):
6868
finally:
6969
if job.interval:
7070
new_scheduled_time = (job.scheduled or job.started) + timedelta(minutes=job.interval)
71+
if job.object and getattr(job.object, "python_class", None):
72+
kwargs["job_timeout"] = job.object.python_class.job_timeout
7173
cls.enqueue(
7274
instance=job.object,
7375
user=job.user,

0 commit comments

Comments
 (0)