Reset Mechanism

This commit is contained in:
proitlab committed 2026-07-29 16:15:02 +07:00
1 parent e8893a3aa4
commit b63e2fa2fa
3 files changed
+11 -4

No files matched your search

+6 -3
View File
@@ -3,12 +3,16 @@ Production batch persistence for edge Jetson counter.
Mirrors frigate-counter SQLite schema + current_batch.json contract.
"""
import json
import os
import sqlite3
import threading
import time
from datetime import datetime, timedelta
from pathlib import Path
_SHMD = os.getenv("SHM_DIR", "/dev/shm/bytetrack-counter")
_RESET_FLAG = Path(f"{_SHMD}/.reset")
class BatchStore:
def __init__(
@@ -195,9 +199,8 @@ class BatchStore:
self.log('Ignore batch label cooldown finished')
def _check_reset_signal(self):
reset_file = Path(str(self.state_file) + ".reset")
if reset_file.exists():
reset_file.unlink(missing_ok=True)
if _RESET_FLAG.exists():
_RESET_FLAG.unlink(missing_ok=True)
if self.current_state is not None:
self.log("External reset signal — clearing in-memory state")
self.current_state = None