- Detection/__main__.py +16 -0
Detection/__main__.py
CHANGED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import logging
|
2 |
+
from .utils import DetectionManager
|
3 |
+
|
4 |
+
if __name__ == "__main__":
|
5 |
+
manager = DetectionManager()
|
6 |
+
try:
|
7 |
+
manager.loop.run_until_complete(manager.run())
|
8 |
+
except KeyboardInterrupt:
|
9 |
+
logging.info("🟠 Shutdown requested by user")
|
10 |
+
except Exception as e:
|
11 |
+
logging.critical(f"🔴 Startup failed: {e}", exc_info=True)
|
12 |
+
finally:
|
13 |
+
if manager.loop.is_running():
|
14 |
+
manager.loop.run_until_complete(manager.loop.shutdown_asyncgens())
|
15 |
+
manager.loop.close()
|
16 |
+
logging.info("🔴 Detection Manager stopped")
|