infinite retries

This commit is contained in:
Siwat Sirichai 2025-01-14 22:19:01 +07:00
parent 5d17a1b759
commit c40cea786e
2 changed files with 2 additions and 2 deletions

2
app.py
View file

@ -94,7 +94,7 @@ async def detect(websocket: WebSocket):
cap.release() cap.release()
time.sleep(reconnect_interval) time.sleep(reconnect_interval)
retries += 1 retries += 1
if retries > max_retries: if retries > max_retries and max_retries != -1:
logging.error(f"Max retries reached after OpenCV error for camera: {camera_id}") logging.error(f"Max retries reached after OpenCV error for camera: {camera_id}")
break break
# Re-open the VideoCapture # Re-open the VideoCapture

View file

@ -3,5 +3,5 @@
"max_streams": 5, "max_streams": 5,
"target_fps": 2, "target_fps": 2,
"reconnect_interval_sec": 5, "reconnect_interval_sec": 5,
"max_retries": 3 "max_retries": -1
} }