import logging from .utils import DetectionManager if __name__ == "__main__": manager = DetectionManager() try: manager.loop.run_until_complete(manager.run()) except KeyboardInterrupt: logging.info("🟠 Shutdown requested by user") except Exception as e: logging.critical(f"🔴 Startup failed: {e}", exc_info=True) finally: if manager.loop.is_running(): manager.loop.run_until_complete(manager.loop.shutdown_asyncgens()) manager.loop.close() logging.info("🔴 Detection Manager stopped")