From e8e95f5e97a684fd26d04289f86e3dbce8ac29cc Mon Sep 17 00:00:00 2001 From: Artem Kotik Date: Wed, 16 Oct 2024 11:39:23 +0200 Subject: [PATCH] Add job timeout handling in JobRunner for periodic jobs --- netbox/netbox/jobs.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/netbox/netbox/jobs.py b/netbox/netbox/jobs.py index 087c24896..ae8f2f109 100644 --- a/netbox/netbox/jobs.py +++ b/netbox/netbox/jobs.py @@ -68,6 +68,8 @@ class JobRunner(ABC): finally: if 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( instance=job.object, user=job.user,