mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-10 20:00:10 +00:00
@@ -1,5 +1,7 @@
|
||||
from django.conf import settings
|
||||
from django.db import transaction
|
||||
from django.db.models import Count
|
||||
from django.db.transaction import atomic
|
||||
from django.shortcuts import get_object_or_404
|
||||
from rest_framework.response import Response
|
||||
from rest_framework.views import APIView
|
||||
@@ -86,7 +88,8 @@ class JobViewSet(OrgBulkModelViewSet):
|
||||
execution.save()
|
||||
|
||||
set_task_to_serializer_data(serializer, execution.id)
|
||||
run_ops_job_execution.apply_async((str(execution.id),), task_id=str(execution.id))
|
||||
transaction.on_commit(
|
||||
lambda: run_ops_job_execution.apply_async((str(execution.id),), task_id=str(execution.id)))
|
||||
|
||||
|
||||
class JobExecutionViewSet(OrgBulkModelViewSet):
|
||||
@@ -109,7 +112,8 @@ class JobExecutionViewSet(OrgBulkModelViewSet):
|
||||
instance.save()
|
||||
|
||||
set_task_to_serializer_data(serializer, instance.id)
|
||||
run_ops_job_execution.apply_async((str(instance.id),), task_id=str(instance.id))
|
||||
transaction.on_commit(
|
||||
lambda: run_ops_job_execution.apply_async((str(instance.id),), task_id=str(instance.id)))
|
||||
|
||||
def get_queryset(self):
|
||||
queryset = super().get_queryset()
|
||||
|
Reference in New Issue
Block a user