Clean all /dev/shm counters on batch start

Wipe chicken_counter_* directories on batch start so dashboard
starts clean and populates as each camera runs.
This commit is contained in:
proitlab committed 2026-07-22 14:42:05 +07:00
1 parent ae86821165
commit 9512fc7f4d
1 file changed
+8
+8
View File
@@ -2,6 +2,7 @@
from __future__ import annotations
import shutil
from datetime import date as date_type
from pathlib import Path
@@ -75,6 +76,13 @@ def run_daily_batch(settings: BatchSettings, date: str | None = None, *, verbose
print(f"[batch] starting daily run for {run_date}")
print(f"[batch] input folder: {day_dir}")
print(f"[batch] output folder: {output_dir}")
# Clean all /dev/shm counters from previous runs
shm_dir = Path("/dev/shm")
for d in shm_dir.glob("chicken_counter_*"):
if d.is_dir():
shutil.rmtree(str(d))
print(f"[batch] cleaned {d}")
if no_video:
print("[batch] --no-video: skipping video output, overlay, and compression")