mirror of
https://github.com/blakeblackshear/frigate.git
synced 2025-02-14 00:17:05 +01:00
make expire interval configurable for users wanting to minimize i/o
This commit is contained in:
parent
7e7d70aa5b
commit
f512af2563
@ -229,6 +229,9 @@ record:
|
|||||||
# will fit within the available disk space of your drive or Frigate
|
# will fit within the available disk space of your drive or Frigate
|
||||||
# will crash.
|
# will crash.
|
||||||
enabled: False
|
enabled: False
|
||||||
|
# Optional: Number of minutes to wait between cleanup runs (default: shown below)
|
||||||
|
# This can be used to reduce the frequency of deleting recording segments from disk if you want to minimize i/o
|
||||||
|
expire_interval: 60
|
||||||
# Optional: Retention settings for recording
|
# Optional: Retention settings for recording
|
||||||
retain:
|
retain:
|
||||||
# Optional: Number of days to retain recordings regardless of events (default: shown below)
|
# Optional: Number of days to retain recordings regardless of events (default: shown below)
|
||||||
|
@ -103,6 +103,10 @@ class RecordRetainConfig(FrigateBaseModel):
|
|||||||
|
|
||||||
class RecordConfig(FrigateBaseModel):
|
class RecordConfig(FrigateBaseModel):
|
||||||
enabled: bool = Field(default=False, title="Enable record on all cameras.")
|
enabled: bool = Field(default=False, title="Enable record on all cameras.")
|
||||||
|
expire_interval: int = Field(
|
||||||
|
default=60,
|
||||||
|
title="Number of minutes to wait between cleanup runs.",
|
||||||
|
)
|
||||||
# deprecated - to be removed in a future version
|
# deprecated - to be removed in a future version
|
||||||
retain_days: Optional[float] = Field(title="Recording retention period in days.")
|
retain_days: Optional[float] = Field(title="Recording retention period in days.")
|
||||||
retain: RecordRetainConfig = Field(
|
retain: RecordRetainConfig = Field(
|
||||||
|
@ -549,7 +549,7 @@ class RecordingCleanup(threading.Thread):
|
|||||||
# self.sync_recordings()
|
# self.sync_recordings()
|
||||||
|
|
||||||
# Expire tmp clips every minute, recordings and clean directories every hour.
|
# Expire tmp clips every minute, recordings and clean directories every hour.
|
||||||
for counter in itertools.cycle(range(60)):
|
for counter in itertools.cycle(range(self.config.record.expire_interval)):
|
||||||
if self.stop_event.wait(60):
|
if self.stop_event.wait(60):
|
||||||
logger.info(f"Exiting recording cleanup...")
|
logger.info(f"Exiting recording cleanup...")
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user