mirror of https://github.com/jumpserver/jumpserver
perf: 优化创建子节点时锁置后
parent
d70351e6b3
commit
a78ccc9667
|
@ -39,7 +39,6 @@ class NodeChildrenApi(generics.ListCreateAPIView):
|
|||
self.instance = self.get_object()
|
||||
|
||||
def perform_create(self, serializer):
|
||||
with NodeAddChildrenLock(self.instance):
|
||||
data = serializer.validated_data
|
||||
_id = data.get("id")
|
||||
value = data.get("value")
|
||||
|
@ -49,6 +48,7 @@ class NodeChildrenApi(generics.ListCreateAPIView):
|
|||
raise JMSException(_('The same level node name cannot be the same'))
|
||||
else:
|
||||
value = self.instance.get_next_child_preset_name()
|
||||
with NodeAddChildrenLock(self.instance):
|
||||
node = self.instance.create_child(value=value, _id=_id)
|
||||
# 避免查询 full value
|
||||
node._full_value = node.value
|
||||
|
|
Loading…
Reference in New Issue