Refactor event loop handling to use GlobalVar.CURRENT_EVENT_LOOP across multiple modules, improving consistency and maintainability.

This commit is contained in:
jxxghp
2025-11-19 08:42:07 +08:00
parent 6b575f836a
commit b5a6794381
7 changed files with 22 additions and 33 deletions

View File

@@ -1,5 +1,4 @@
import asyncio
from app.core.config import GlobalVar
from app.core.plugin import PluginManager
from app.log import logger
@@ -9,7 +8,7 @@ async def sync_plugins() -> bool:
初始化安装插件并动态注册后台任务及API
"""
try:
loop = asyncio.get_event_loop()
loop = GlobalVar.CURRENT_EVENT_LOOP
plugin_manager = PluginManager()
sync_result = await execute_task(loop, plugin_manager.sync, "插件同步到本地")