From 1bbb5eaf6f5508ad805eea2faac9050a7e404285 Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 9 Mar 2023 11:45:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AD=98=E5=82=A8?= =?UTF-8?q?=E6=95=85=E9=9A=9C=E9=80=A0=E6=88=90=E7=9A=84=E5=BD=95=E5=83=8F?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E5=A4=B1=E8=B4=A5=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/terminal/models/session.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/terminal/models/session.py b/apps/terminal/models/session.py index 8eff9368b..2b059d6b6 100644 --- a/apps/terminal/models/session.py +++ b/apps/terminal/models/session.py @@ -117,9 +117,13 @@ class Session(OrgModelMixin): def find_ok_relative_path_in_storage(self, storage): session_paths = self.get_all_possible_relative_path() for rel_path in session_paths: - if storage.exists(rel_path): - return rel_path - + # storage 为多个外部存储时, 可能会因部分不可用, + # 抛出异常, 影响录像的获取 + try: + if storage.exists(rel_path): + return rel_path + except: + pass @property def asset_obj(self): return Asset.objects.get(id=self.asset_id)