Merge pull request #2614 from InfinityPacer/main

This commit is contained in:
jxxghp 2024-07-30 06:33:00 +08:00 committed by GitHub
commit 74a4d0bd66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,3 +1,4 @@
import copy
import importlib import importlib
import threading import threading
import traceback import traceback
@ -11,8 +12,7 @@ from app.chain.subscribe import SubscribeChain
from app.chain.system import SystemChain from app.chain.system import SystemChain
from app.chain.transfer import TransferChain from app.chain.transfer import TransferChain
from app.core.config import settings from app.core.config import settings
from app.core.event import Event as ManagerEvent from app.core.event import Event as ManagerEvent, eventmanager, EventManager
from app.core.event import eventmanager, EventManager
from app.core.plugin import PluginManager from app.core.plugin import PluginManager
from app.helper.message import MessageHelper from app.helper.message import MessageHelper
from app.helper.thread import ThreadHelper from app.helper.thread import ThreadHelper
@ -194,7 +194,7 @@ class Command(metaclass=Singleton):
# 插件事件 # 插件事件
self.threader.submit( self.threader.submit(
self.pluginmanager.run_plugin_method, self.pluginmanager.run_plugin_method,
class_name, method_name, event class_name, method_name, copy.deepcopy(event)
) )
else: else:
@ -217,7 +217,7 @@ class Command(metaclass=Singleton):
if hasattr(class_obj, method_name): if hasattr(class_obj, method_name):
self.threader.submit( self.threader.submit(
getattr(class_obj, method_name), getattr(class_obj, method_name),
event copy.deepcopy(event)
) )
except Exception as e: except Exception as e:
logger.error(f"事件处理出错:{str(e)} - {traceback.format_exc()}") logger.error(f"事件处理出错:{str(e)} - {traceback.format_exc()}")