forked from zakaria/chicken-counting-sukawarna-det
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:
1 parent
ae86821165
commit
9512fc7f4d
1 file changed
+8
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import shutil
|
||||||
from datetime import date as date_type
|
from datetime import date as date_type
|
||||||
from pathlib import Path
|
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] starting daily run for {run_date}")
|
||||||
print(f"[batch] input folder: {day_dir}")
|
print(f"[batch] input folder: {day_dir}")
|
||||||
print(f"[batch] output folder: {output_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:
|
if no_video:
|
||||||
print("[batch] --no-video: skipping video output, overlay, and compression")
|
print("[batch] --no-video: skipping video output, overlay, and compression")
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user