mirror of https://github.com/jumpserver/jumpserver
Merge pull request #11578 from jumpserver/pr@dev@perf_host_deploy_log
perf: 修复发布机历史执行任务日志无法查看的问题pull/11580/head
commit
bb1e674367
|
@ -59,12 +59,12 @@ class AppletHostDeploymentViewSet(viewsets.ModelViewSet):
|
|||
@staticmethod
|
||||
def start_deploy(instance):
|
||||
task = run_applet_host_deployment.apply_async((instance.id,), task_id=str(instance.id))
|
||||
instance.save_task(task.id)
|
||||
|
||||
def create(self, request, *args, **kwargs):
|
||||
serializer = self.get_serializer(data=request.data)
|
||||
serializer.is_valid(raise_exception=True)
|
||||
instance = serializer.save()
|
||||
instance.save_task(instance.id)
|
||||
transaction.on_commit(lambda: self.start_deploy(instance))
|
||||
return Response({'task': str(instance.id)}, status=201)
|
||||
|
||||
|
|
Loading…
Reference in New Issue