Enhance Docker Compose configuration and improve camera manager error handling
- Added container names for better identification of services in docker-compose.yml. - Refactored CameraManager to include error handling during initialization of camera recorders and streamers, ensuring the system remains operational even if some components fail. - Updated frontend components to support new MQTT Debug Panel functionality, enhancing monitoring capabilities.
This commit is contained in:
@@ -75,18 +75,31 @@ class CameraManager:
|
||||
self.logger.info("Starting camera manager...")
|
||||
self.running = True
|
||||
|
||||
# Start camera monitor
|
||||
if self.camera_monitor:
|
||||
self.camera_monitor.start()
|
||||
try:
|
||||
# Start camera monitor
|
||||
if self.camera_monitor:
|
||||
self.camera_monitor.start()
|
||||
|
||||
# Initialize camera recorders
|
||||
self._initialize_recorders()
|
||||
# Initialize camera recorders
|
||||
try:
|
||||
self._initialize_recorders()
|
||||
except Exception as e:
|
||||
self.logger.error(f"Error initializing camera recorders: {e}", exc_info=True)
|
||||
# Continue anyway - some cameras might still work
|
||||
|
||||
# Initialize camera streamers
|
||||
self._initialize_streamers()
|
||||
# Initialize camera streamers
|
||||
try:
|
||||
self._initialize_streamers()
|
||||
except Exception as e:
|
||||
self.logger.error(f"Error initializing camera streamers: {e}", exc_info=True)
|
||||
# Continue anyway - streaming is optional
|
||||
|
||||
self.logger.info("Camera manager started successfully")
|
||||
return True
|
||||
self.logger.info("Camera manager started successfully")
|
||||
return True
|
||||
except Exception as e:
|
||||
self.logger.error(f"Critical error starting camera manager: {e}", exc_info=True)
|
||||
self.running = False
|
||||
return False
|
||||
|
||||
def stop(self) -> None:
|
||||
"""Stop the camera manager"""
|
||||
|
||||
Reference in New Issue
Block a user