forked from Github/frigate
Don't fail when preview restore fails (#12022)
* Don't fail when preview restore fails * Cleanup
This commit is contained in:
@@ -174,6 +174,7 @@ def move_preview_frames(loc: str):
|
|||||||
preview_holdover = os.path.join(CLIPS_DIR, "preview_restart_cache")
|
preview_holdover = os.path.join(CLIPS_DIR, "preview_restart_cache")
|
||||||
preview_cache = os.path.join(CACHE_DIR, "preview_frames")
|
preview_cache = os.path.join(CACHE_DIR, "preview_frames")
|
||||||
|
|
||||||
|
try:
|
||||||
if loc == "clips":
|
if loc == "clips":
|
||||||
shutil.move(preview_cache, preview_holdover)
|
shutil.move(preview_cache, preview_holdover)
|
||||||
elif loc == "cache":
|
elif loc == "cache":
|
||||||
@@ -181,3 +182,5 @@ def move_preview_frames(loc: str):
|
|||||||
return
|
return
|
||||||
|
|
||||||
shutil.move(preview_holdover, preview_cache)
|
shutil.move(preview_holdover, preview_cache)
|
||||||
|
except shutil.Error:
|
||||||
|
logger.error("Failed to restore preview cache.")
|
||||||
|
|||||||
Reference in New Issue
Block a user