Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't fail when preview restore fails #12022

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Next Next commit
Don't fail when preview restore fails
  • Loading branch information
NickM-27 committed Jun 17, 2024
commit 73d7498246cff3b2c6439ff2179eb43e9744975c
16 changes: 10 additions & 6 deletions frigate/output/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,14 @@ 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
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)
shutil.move(preview_holdover, preview_cache)

except shutil.Error:
logger.error("Failed to restore preview cache.")