Browse Source

preview load timeout fix 2

master
gsd 7 months ago
parent
commit
d44bbbcc90
  1. 11
      backend/config_parser.py

11
backend/config_parser.py

@ -301,10 +301,15 @@ class TranscodeTools:
async for chunk in nvr.stream_file(file, preview_pre_bytes):
await raw.write(chunk)
except asyncio.TimeoutError as te:
idx = self.preview_storage.index(preview_file)
del self.preview_storage[idx]
try:
idx = self.preview_storage.index(preview_file)
del self.preview_storage[idx]
except:
self.preview_storage = []
self.logger.info(f"Cancel download file: {te}")
os.remove(raw_file)
if os.path.exists(raw_file):
os.remove(raw_file)
finally:
nvr.logout()

Loading…
Cancel
Save