perf(methods): 通过移除不必要的 self 参数优化方法签名
在包括 chat、plugin_system、schedule 和 mais4u 在内的多个模块中,消除冗余的实例引用。此次改动将无需访问实例状态的实用函数转换为静态方法,从而提升了内存效率,并使方法依赖关系更加清晰。
This commit is contained in:
@@ -4,16 +4,14 @@
|
||||
支持自动重连、连接池管理和更好的错误处理
|
||||
"""
|
||||
|
||||
import traceback
|
||||
import time
|
||||
import asyncio
|
||||
from typing import Dict, List, Any, Union, Type, Optional
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
import traceback
|
||||
from typing import Dict, List, Any, Union, Optional
|
||||
|
||||
from sqlalchemy import desc, asc, func, and_, select
|
||||
from sqlalchemy.ext.asyncio import AsyncSession
|
||||
from src.common.logger import get_logger
|
||||
from sqlalchemy.exc import SQLAlchemyError
|
||||
|
||||
from src.common.database.sqlalchemy_models import (
|
||||
Base,
|
||||
get_db_session,
|
||||
Messages,
|
||||
ActionRecords,
|
||||
@@ -33,6 +31,7 @@ from src.common.database.sqlalchemy_models import (
|
||||
MaiZoneScheduleStatus,
|
||||
CacheEntries,
|
||||
)
|
||||
from src.common.logger import get_logger
|
||||
|
||||
logger = get_logger("sqlalchemy_database_api")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user