refactor: yirimirai 适配器实现异步

This commit is contained in:
RockChinQ
2024-01-23 22:28:30 +08:00
parent 8d35ecd711
commit ad5ef95e65
8 changed files with 88 additions and 62 deletions

View File

@@ -7,6 +7,7 @@ from ..openai import manager as openai_mgr
from ..config import manager as config_mgr
from ..database import manager as database_mgr
from ..utils.center import v2 as center_mgr
from ..plugin import host as plugin_host
class Application:
@@ -28,4 +29,7 @@ class Application:
pass
async def run(self):
pass
# TODO make it async
plugin_host.initialize_plugins()
await self.im_mgr.run()

View File

@@ -44,4 +44,11 @@ async def init_logging() -> logging.Logger:
)
qcg_logger.addHandler(handler)
logging.basicConfig(level=level, # 设置日志输出格式
format="[DEPR][%(asctime)s.%(msecs)03d] %(pathname)s (%(lineno)d) - [%(levelname)s] :\n%(message)s",
# 日志输出的格式
# -8表示占位符让输出左对齐输出长度都为8位
datefmt="%Y-%m-%d %H:%M:%S" # 时间输出的格式
)
return qcg_logger