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

v2.26
Eric 2023-03-09 11:45:25 +08:00 committed by Jiangjie.Bai
parent b5b7cd7693
commit 1bbb5eaf6f
1 changed files with 7 additions and 3 deletions

View File

@ -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)