From c40cea786e1b11a0e114096f5c2d7912456456b0 Mon Sep 17 00:00:00 2001 From: Siwat Sirichai Date: Tue, 14 Jan 2025 22:19:01 +0700 Subject: [PATCH] infinite retries --- app.py | 2 +- config.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index 994d36c..e4adce5 100644 --- a/app.py +++ b/app.py @@ -94,7 +94,7 @@ async def detect(websocket: WebSocket): cap.release() time.sleep(reconnect_interval) 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}") break # Re-open the VideoCapture diff --git a/config.json b/config.json index b9ffa8f..311bbf4 100644 --- a/config.json +++ b/config.json @@ -3,5 +3,5 @@ "max_streams": 5, "target_fps": 2, "reconnect_interval_sec": 5, - "max_retries": 3 + "max_retries": -1 }