feat: optimize AI suggestion and workorder sync - support same-day multiple update numbering - insert new suggestions at top maintaining reverse chronological order - reference process history when generating suggestions - simplify prompts to avoid forcing log analysis - fix Chinese comment encoding issues
This commit is contained in:
Binary file not shown.
BIN
src/core/__pycache__/backup_manager.cpython-311.pyc
Normal file
BIN
src/core/__pycache__/backup_manager.cpython-311.pyc
Normal file
Binary file not shown.
BIN
src/core/__pycache__/cache_manager.cpython-311.pyc
Normal file
BIN
src/core/__pycache__/cache_manager.cpython-311.pyc
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
src/core/__pycache__/query_optimizer.cpython-311.pyc
Normal file
BIN
src/core/__pycache__/query_optimizer.cpython-311.pyc
Normal file
Binary file not shown.
BIN
src/core/__pycache__/redis_manager.cpython-311.pyc
Normal file
BIN
src/core/__pycache__/redis_manager.cpython-311.pyc
Normal file
Binary file not shown.
BIN
src/core/__pycache__/system_optimizer.cpython-311.pyc
Normal file
BIN
src/core/__pycache__/system_optimizer.cpython-311.pyc
Normal file
Binary file not shown.
@@ -288,9 +288,6 @@ class QueryOptimizer:
|
||||
category_counts = Counter([wo.category for wo in workorders])
|
||||
priority_counts = Counter([wo.priority for wo in workorders])
|
||||
|
||||
# 调试信息
|
||||
logger.info(f"工单状态统计: {dict(status_counts)}")
|
||||
logger.info(f"工单总数: {total}")
|
||||
|
||||
# 处理状态映射(支持中英文状态)
|
||||
status_mapping = {
|
||||
@@ -317,8 +314,6 @@ class QueryOptimizer:
|
||||
if not mapped:
|
||||
logger.warning(f"未映射的状态: '{status}' (数量: {count})")
|
||||
|
||||
# 调试信息
|
||||
logger.info(f"映射后的状态统计: {mapped_counts}")
|
||||
|
||||
resolved_count = mapped_counts['resolved']
|
||||
|
||||
@@ -394,9 +389,6 @@ class QueryOptimizer:
|
||||
if len(self.query_stats[query_name]) > 100:
|
||||
self.query_stats[query_name] = self.query_stats[query_name][-100:]
|
||||
|
||||
# 记录慢查询
|
||||
if query_time > self.slow_query_threshold:
|
||||
logger.warning(f"慢查询检测: {query_name} 耗时 {query_time:.2f}s")
|
||||
|
||||
def get_query_performance_report(self) -> Dict[str, Any]:
|
||||
"""获取查询性能报告"""
|
||||
@@ -438,7 +430,6 @@ class QueryOptimizer:
|
||||
logger.warning(f"创建索引失败: {e}")
|
||||
|
||||
session.commit()
|
||||
logger.info("数据库索引优化完成")
|
||||
return True
|
||||
|
||||
except Exception as e:
|
||||
|
||||
@@ -75,7 +75,6 @@ class SystemOptimizer:
|
||||
)
|
||||
self.redis_client.ping()
|
||||
self.redis_connected = True
|
||||
logger.info("系统优化Redis连接成功")
|
||||
except Exception as e:
|
||||
logger.debug(f"系统优化Redis连接失败: {e}")
|
||||
self.redis_client = None
|
||||
@@ -91,7 +90,6 @@ class SystemOptimizer:
|
||||
|
||||
monitor_thread = threading.Thread(target=self._monitor_system, daemon=True)
|
||||
monitor_thread.start()
|
||||
logger.info("系统监控线程已启动")
|
||||
except Exception as e:
|
||||
logger.error(f"启动监控线程失败: {e}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user