INNER CODE UNIT · Python
MainApp
yihong1120/Construction-Hazard-Detection · main.py:34
class MainApp:
"""
Core application responsible for:
- Reacting to PostgreSQL configuration notifications with a bounded
polling fallback
- Dynamically spawning/stopping child processes for each video stream
- Cleaning up expired or modified configurations
"""
def __init__(self, poll_interval: int = 300) -> None:
"""Initialise the application.
Args:
poll_interval (int): Maximum seconds between fallback database
refreshes when PostgreSQL notifications are unavailable.
"""
self.poll_interval = max(1, poll_interval)
self.logger = LoggerConfig().get_logger()