This commit is contained in:
2026-07-26 17:57:44 +08:00
parent a555f785ba
commit 069f1bafe1
27 changed files with 4893 additions and 3846 deletions
+8 -2
View File
@@ -31,7 +31,7 @@ class Jx3ApiPlugin(Star):
if self.prefix.get("enable"):
logger.info(f"已启用指令前缀功能,前缀为:{self.prefix.get('text')}")
else:
logger.info(f"未启用指令前缀功能。")
logger.info("未启用指令前缀功能。")
# 默认服务器
self.server = self.conf.get("server","梦江南")
@@ -54,6 +54,9 @@ class Jx3ApiPlugin(Star):
async def initialize(self):
"""可选择实现异步的插件初始化方法,当实例化该插件类之后会自动调用该方法。"""
try:
# 显式创建 HTTP Session,避免首次并发请求时重复创建连接池
await self.jx3api.start()
# 数据库初始化
await self.init_bilei_data()
await self.init_tuishong_data()
@@ -65,9 +68,12 @@ class Jx3ApiPlugin(Star):
# 开启后台推送
await self.jx3at.init_tasks()
except Exception as e:
except Exception:
if self.jx3at is not None:
await self.jx3at.destroy()
await self.jx3api.close()
await self.local_sql_db.close()
await self.plugin_sql_db.close()
logger.exception("功能模块初始化失败")
raise