Skip to content

Commit

Permalink
Don't fail when preview restore fails (#12022)
Browse files Browse the repository at this point in the history
* Don't fail when preview restore fails

* Cleanup
  • Loading branch information
NickM-27 committed Jun 17, 2024
1 parent ba6fc0f commit 2477014
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions frigate/output/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,13 @@ def move_preview_frames(loc: str):
preview_holdover = os.path.join(CLIPS_DIR, "preview_restart_cache")
preview_cache = os.path.join(CACHE_DIR, "preview_frames")

if loc == "clips":
shutil.move(preview_cache, preview_holdover)
elif loc == "cache":
if not os.path.exists(preview_holdover):
return

shutil.move(preview_holdover, preview_cache)
try:
if loc == "clips":
shutil.move(preview_cache, preview_holdover)
elif loc == "cache":
if not os.path.exists(preview_holdover):
return

shutil.move(preview_holdover, preview_cache)
except shutil.Error:
logger.error("Failed to restore preview cache.")

0 comments on commit 2477014

Please sign in to comment.