forked from Github/frigate
Add option for enabling sync recordings (#7169)
This commit is contained in:
@@ -193,6 +193,9 @@ class RecordRetainConfig(FrigateBaseModel):
|
||||
|
||||
class RecordConfig(FrigateBaseModel):
|
||||
enabled: bool = Field(default=False, title="Enable record on all cameras.")
|
||||
sync_on_startup: bool = Field(
|
||||
default=False, title="Sync recordings with disk on startup."
|
||||
)
|
||||
expire_interval: int = Field(
|
||||
default=60,
|
||||
title="Number of minutes to wait between cleanup runs.",
|
||||
|
||||
@@ -222,8 +222,9 @@ class RecordingCleanup(threading.Thread):
|
||||
logger.debug("End sync recordings.")
|
||||
|
||||
def run(self) -> None:
|
||||
# on startup sync recordings with disk
|
||||
self.sync_recordings()
|
||||
# on startup sync recordings with disk if enabled
|
||||
if self.config.record.sync_on_startup:
|
||||
self.sync_recordings()
|
||||
|
||||
# Expire tmp clips every minute, recordings and clean directories every hour.
|
||||
for counter in itertools.cycle(range(self.config.record.expire_interval)):
|
||||
|
||||
Reference in New Issue
Block a user