mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-01-23 04:28:32 +03:00
use same logging pattern in sync_recordings as the other sync functions (#21625)
This commit is contained in:
parent
f1a19128ed
commit
e5fec56893
@ -198,16 +198,20 @@ def sync_recordings(
|
|||||||
result.aborted = True
|
result.aborted = True
|
||||||
return result
|
return result
|
||||||
|
|
||||||
if files_to_delete and not dry_run:
|
if dry_run:
|
||||||
logger.info(
|
logger.info(
|
||||||
f"Deleting {len(files_to_delete)} recordings files with missing DB entries"
|
f"Recordings sync (dry run): Found {len(files_to_delete)} orphaned files"
|
||||||
)
|
)
|
||||||
for file in files_to_delete:
|
return result
|
||||||
try:
|
|
||||||
os.unlink(file)
|
# Delete orphans
|
||||||
result.orphans_deleted += 1
|
logger.info(f"Deleting {len(files_to_delete)} orphaned recordings files")
|
||||||
except OSError as e:
|
for file in files_to_delete:
|
||||||
logger.error(f"Failed to delete {file}: {e}")
|
try:
|
||||||
|
os.unlink(file)
|
||||||
|
result.orphans_deleted += 1
|
||||||
|
except OSError as e:
|
||||||
|
logger.error(f"Failed to delete {file}: {e}")
|
||||||
|
|
||||||
logger.debug("End sync recordings.")
|
logger.debug("End sync recordings.")
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user