From 54a13531c4d873b30f90dddf4cf3140d3e25ea0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E6=9D=B0=20Jie=20Zhao=20=EF=BC=88=E9=9B=84?= =?UTF-8?q?=E7=8B=AE=E6=B1=BD=E8=BD=A6=E7=A7=91=E6=8A=80=EF=BC=89?= <00061074@chery.local> Date: Mon, 22 Sep 2025 13:29:14 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BF=AB=E9=80=9F=E6=8F=90=E4=BA=A4=20?= =?UTF-8?q?-=20=E5=91=A8=E4=B8=80=202025/09/22=2013:29:14.32?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/web/blueprints/system.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/web/blueprints/system.py b/src/web/blueprints/system.py index 5a93d35..f0e7240 100644 --- a/src/web/blueprints/system.py +++ b/src/web/blueprints/system.py @@ -8,6 +8,7 @@ import os import json import psutil from flask import Blueprint, request, jsonify +from sqlalchemy import text from src.core.backup_manager import backup_manager from src.core.database import db_manager from src.core.models import WorkOrder, Conversation, KnowledgeEntry, VehicleData, Alert @@ -126,7 +127,7 @@ def get_system_optimizer_status(): import time start_time = time.time() with db_manager.get_session() as session: - session.execute("SELECT 1") + session.execute(text("SELECT 1")) network_latency = round((time.time() - start_time) * 1000, 1) except: network_latency = 0 @@ -137,7 +138,7 @@ def get_system_optimizer_status(): # 基于实际数据库连接状态 try: with db_manager.get_session() as session: - session.execute("SELECT 1") + session.execute(text("SELECT 1")) database_health = 100 except: database_health = 0