1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

Allow setting individual timeouts on scripts and reports

This commit is contained in:
kkthxbye-code
2022-04-04 18:00:38 +02:00
parent e2b6d69596
commit 36d6ae33d1
7 changed files with 25 additions and 8 deletions

View File

@@ -13,6 +13,7 @@ from django.urls import reverse
from django.utils import timezone
from django.utils.formats import date_format
from rest_framework.utils.encoders import JSONEncoder
import django_rq
from extras.choices import *
from extras.constants import *
@@ -549,8 +550,9 @@ class JobResult(models.Model):
user=user,
job_id=uuid.uuid4()
)
func.delay(*args, job_id=str(job_result.job_id), job_result=job_result, **kwargs)
queue = django_rq.get_queue("default")
queue.enqueue(func, job_id=str(job_result.job_id), job_result=job_result, **kwargs)
return job_result