完善牧安云哨-后端
This commit is contained in:
+7
-4
@@ -4,6 +4,7 @@ from fastapi import FastAPI
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from uvicorn import Config, Server
|
||||
|
||||
from config.emqx import mqtt_client_async
|
||||
from config.yolo import YOLOSingleton
|
||||
from routers.Bot import botRouter
|
||||
from routers.Chat import chatRouter
|
||||
@@ -18,6 +19,7 @@ from routers.Service import serviceRouter
|
||||
from routers.System import systemRouter
|
||||
from routers.Vision import visionRouter
|
||||
from routers.WS import iot_ws_router
|
||||
from service.RabbitMQ import sentinel_pull_analysis_async
|
||||
|
||||
|
||||
async def ai_lab():
|
||||
@@ -63,6 +65,11 @@ async def main():
|
||||
YOLOSingleton.init_model()
|
||||
# 主干AI实验室FastAPI服务
|
||||
task_api = asyncio.create_task(ai_lab())
|
||||
# RabbitMQ服务
|
||||
task_mq = asyncio.create_task(sentinel_pull_analysis_async())
|
||||
# 等 HTTP 服务启动后再启动 MQTT
|
||||
task_mqtt = asyncio.create_task(mqtt_client_async())
|
||||
await asyncio.gather(task_api, task_mq, task_mqtt)
|
||||
|
||||
# MCP服务-ailab
|
||||
# endpoint_url_ai_lab = "wss://ai.ronsunny.cn:8090/aimcp/mcp_endpoint/mcp/?token=TsSP9lBq6Oa1WMkachHoS2TtNt4GKV/Gli24pk5Rjpk%3D"
|
||||
@@ -73,11 +80,7 @@ async def main():
|
||||
# endpoint_url_ql = "wss://ai.ronsunny.cn:8090/aimcp/mcp_endpoint/mcp/?token=8ZmCzp7FzsbxwHOg2%2FvBQkxrC3QWJiI%2B4iTfouExinjcT8ZgLwQfFUtgcMInI7St"
|
||||
# task_mcp2 = asyncio.create_task(init_mcp_server(endpoint_url_ql))
|
||||
|
||||
# RabbitMQ服务
|
||||
# task_mq = asyncio.create_task(mq_pull_analysis_async())
|
||||
|
||||
# await asyncio.gather(task_api, task_mcp1, task_mcp2, task_mq)
|
||||
await asyncio.gather(task_api)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user