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") |