feat(statistic): 延迟统计任务启动时间和运行间隔以优化性能

fix(engine): 禁用 SQLAlchemy 查询编译缓存以防止 tuple 膨胀

fix(message_repository): 优化日志输出格式以提高可读性
This commit is contained in:
Windpicker-owo
2025-12-09 21:44:56 +08:00
parent b1fe5b1f08
commit ceee6f38d5
3 changed files with 8 additions and 6 deletions

View File

@@ -114,6 +114,9 @@ def _build_sqlite_config(config) -> tuple[str, dict]:
"check_same_thread": False,
"timeout": 60,
},
# ⚠️ 禁用 SQLAlchemy 查询编译缓存以阻断可能的 tuple 膨胀
# 观察到长时间运行后 tuple 数量飙升,先通过关闭缓存止血
"query_cache_size": 0,
}
logger.debug(f"SQLite配置: {db_path}")
@@ -162,6 +165,8 @@ def _build_postgresql_config(config) -> tuple[str, dict]:
"pool_timeout": config.connection_timeout,
"pool_recycle": 3600,
"pool_pre_ping": True,
# ⚠️ 禁用 SQLAlchemy 查询编译缓存以阻断可能的 tuple 膨胀
"query_cache_size": 0,
}
if connect_args: