infinite retries
This commit is contained in:
		
							parent
							
								
									5d17a1b759
								
							
						
					
					
						commit
						c40cea786e
					
				
					 2 changed files with 2 additions and 2 deletions
				
			
		
							
								
								
									
										2
									
								
								app.py
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -3,5 +3,5 @@
 | 
			
		|||
  "max_streams": 5,
 | 
			
		||||
  "target_fps": 2,
 | 
			
		||||
  "reconnect_interval_sec": 5,
 | 
			
		||||
  "max_retries": 3
 | 
			
		||||
  "max_retries": -1
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue