fix: 修复存储故障造成的录像获取失败问题

pull/9910/head
Eric 2023-03-09 11:45:25 +08:00 committed by Jiangjie.Bai
parent 2662ead1c4
commit fde92a28bd
1 changed files with 7 additions and 3 deletions

View File

@ -105,9 +105,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)