mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-09-24 21:08:30 +00:00
perf: 修复事务中任务执行
This commit is contained in:
@@ -2,7 +2,6 @@ import uuid
|
||||
from copy import deepcopy
|
||||
|
||||
from django.db import IntegrityError
|
||||
from django.db import transaction
|
||||
from django.db.models import Q
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from rest_framework import serializers
|
||||
@@ -121,10 +120,6 @@ class AccountCreateUpdateSerializerMixin(serializers.Serializer):
|
||||
def push_account_if_need(self, instance, push_now, params, stat):
|
||||
if not push_now or stat not in ['created', 'updated']:
|
||||
return
|
||||
transaction.on_commit(lambda: self.start_push(instance, params))
|
||||
|
||||
@staticmethod
|
||||
def start_push(instance, params):
|
||||
push_accounts_to_assets_task.delay([str(instance.id)], params)
|
||||
|
||||
def get_validators(self):
|
||||
|
Reference in New Issue
Block a user