feat(event): improve event consumer logic for handling of events

This commit is contained in:
InfinityPacer
2024-09-20 20:37:29 +08:00
parent 688693b31f
commit 857383c8d0
3 changed files with 121 additions and 116 deletions

View File

@@ -30,6 +30,7 @@ except ImportError as e:
print(error_message, file=sys.stderr)
sys.exit(1)
from app.core.event import EventManager
from app.core.plugin import PluginManager
from app.db.init import init_db, update_db
from app.helper.thread import ThreadHelper
@@ -212,7 +213,7 @@ def shutdown_server():
PluginManager().stop()
PluginManager().stop_monitor()
# 停止事件消费
Command().stop()
EventManager().stop()
# 停止虚拟显示
DisplayHelper().stop()
# 停止定时服务
@@ -245,8 +246,10 @@ def start_module():
Monitor()
# 启动定时服务
Scheduler()
# 启动事件消费
# 加载命令
Command()
# 启动事件消费
EventManager().start()
# 初始化路由
init_routers()
# 启动前端服务