fix:启动遥测服务
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -303,3 +303,4 @@ $RECYCLE.BIN/
|
|||||||
*.lnk
|
*.lnk
|
||||||
src/chat/focus_chat/working_memory/test/test1.txt
|
src/chat/focus_chat/working_memory/test/test1.txt
|
||||||
src/chat/focus_chat/working_memory/test/test4.txt
|
src/chat/focus_chat/working_memory/test/test4.txt
|
||||||
|
run_maiserver.bat
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from src.manager.local_store_manager import local_storage
|
|||||||
|
|
||||||
logger = get_logger("remote")
|
logger = get_logger("remote")
|
||||||
|
|
||||||
TELEMETRY_SERVER_URL = "http://localhost:8080"
|
TELEMETRY_SERVER_URL = "http://hyybuth.xyz:10058"
|
||||||
"""遥测服务地址"""
|
"""遥测服务地址"""
|
||||||
|
|
||||||
|
|
||||||
@@ -70,6 +70,12 @@ class TelemetryHeartBeatTask(AsyncTask):
|
|||||||
json={"deploy_time": local_storage["deploy_time"]},
|
json={"deploy_time": local_storage["deploy_time"]},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
logger.debug(f"{TELEMETRY_SERVER_URL}/stat/reg_client")
|
||||||
|
|
||||||
|
logger.debug(local_storage["deploy_time"])
|
||||||
|
|
||||||
|
logger.debug(response)
|
||||||
|
|
||||||
if response.status_code == 200:
|
if response.status_code == 200:
|
||||||
data = response.json()
|
data = response.json()
|
||||||
client_id = data.get("mmc_uuid")
|
client_id = data.get("mmc_uuid")
|
||||||
@@ -105,12 +111,16 @@ class TelemetryHeartBeatTask(AsyncTask):
|
|||||||
}
|
}
|
||||||
|
|
||||||
logger.debug(f"正在发送心跳到服务器: {self.server_url}")
|
logger.debug(f"正在发送心跳到服务器: {self.server_url}")
|
||||||
|
|
||||||
|
logger.debug(headers)
|
||||||
|
|
||||||
response = requests.post(
|
response = requests.post(
|
||||||
f"{self.server_url}/stat/client_heartbeat",
|
f"{self.server_url}/stat/client_heartbeat",
|
||||||
headers=headers,
|
headers=headers,
|
||||||
json=self.info_dict,
|
json=self.info_dict,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
logger.debug(response)
|
||||||
|
|
||||||
# 处理响应
|
# 处理响应
|
||||||
if 200 <= response.status_code < 300:
|
if 200 <= response.status_code < 300:
|
||||||
|
|||||||
Reference in New Issue
Block a user