From 5de6563ab212005accfe1ff0eca0df676f0f7103 Mon Sep 17 00:00:00 2001 From: BaiJiangJie Date: Wed, 26 Jun 2019 17:29:52 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E8=A7=A3=E5=86=B3=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?windows=E8=B5=84=E4=BA=A7=E5=87=BA=E7=8E=B0=E5=B9=BD=E7=81=B5?= =?UTF-8?q?=E4=BC=9A=E8=AF=9D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/terminal/api/session.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/terminal/api/session.py b/apps/terminal/api/session.py index 5d37be0e0..93628af22 100644 --- a/apps/terminal/api/session.py +++ b/apps/terminal/api/session.py @@ -39,6 +39,9 @@ class SessionViewSet(BulkModelViewSet): terminal = get_object_or_404(Terminal, id=terminal_id) queryset = queryset.filter(terminal=terminal) return queryset + # 解决guacamole更新session时并发导致幽灵会话的问题 + if self.request.method in ('PATCH', ): + queryset = queryset.select_for_update() return queryset def perform_create(self, serializer):