소스 검색

Add job timeout handling in JobRunner for periodic jobs

Artem Kotik 1 년 전
부모
커밋
e8e95f5e97
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      netbox/netbox/jobs.py

+ 2 - 0
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,