Update session

This commit is contained in:
proitlab committed 2026-08-01 18:32:35 +07:00
1 parent 7394aedd5b
commit e6d66db84b
4 files changed
+28273 -786

No files matched your search

+28257 -783
View File
File diff suppressed because it is too large. Load diff
+7 -1
View File
@@ -202,11 +202,17 @@ class BatchStore:
if _RESET_FLAG.exists(): if _RESET_FLAG.exists():
_RESET_FLAG.unlink(missing_ok=True) _RESET_FLAG.unlink(missing_ok=True)
if self.current_state is not None: if self.current_state is not None:
self.log("External reset signal — clearing in-memory state") self.log("External reset signal (SHM marker) — clearing in-memory state")
self.current_state = None self.current_state = None
if self.batch_timer: if self.batch_timer:
self.batch_timer.cancel() self.batch_timer.cancel()
self.batch_timer = None self.batch_timer = None
elif self.current_state is not None and not self.state_file.exists():
self.log("External reset signal (state file deleted) — clearing in-memory state")
self.current_state = None
if self.batch_timer:
self.batch_timer.cancel()
self.batch_timer = None
def record_ayam_crossing(self, track_id): def record_ayam_crossing(self, track_id):
"""Line-cross equivalent of production ayam-potong MQTT event.""" """Line-cross equivalent of production ayam-potong MQTT event."""
+2
View File
@@ -9,6 +9,7 @@ import os
import re import re
import subprocess import subprocess
import threading import threading
import time
import requests import requests
from datetime import datetime from datetime import datetime
from pathlib import Path from pathlib import Path
@@ -154,6 +155,7 @@ def start_recount():
try: try:
_http_session.post(f"{RECOUNT_API_URL}/api/reset", timeout=5) _http_session.post(f"{RECOUNT_API_URL}/api/reset", timeout=5)
time.sleep(1)
except Exception: except Exception:
pass pass
+7 -2
View File
@@ -656,6 +656,13 @@ async function startRecount() {
btnStart.disabled = true; btnStart.disabled = true;
btnStart.textContent = 'CONNECTING...'; btnStart.textContent = 'CONNECTING...';
lastRecountCount = null;
lastRecountTime = null;
document.getElementById('recount-count').textContent = '0';
document.getElementById('recount-time').textContent = 'resetting...';
document.getElementById('recount-status').textContent = 'resetting';
document.getElementById('recount-status').className = 'counter-status disconnected';
try { try {
const res = await fetch('/api/start-recount', { const res = await fetch('/api/start-recount', {
method: 'POST', method: 'POST',
@@ -672,8 +679,6 @@ async function startRecount() {
streamUrl = data.stream_url; streamUrl = data.stream_url;
streaming = true; streaming = true;
selectedFile = data.path; selectedFile = data.path;
lastRecountCount = null;
lastRecountTime = null;
document.getElementById('btn-stop').disabled = false; document.getElementById('btn-stop').disabled = false;
btnStart.textContent = 'STREAMING'; btnStart.textContent = 'STREAMING';