mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-09-03 16:17:16 +00:00
feat: 插件更新异常处理
This commit is contained in:
@@ -98,6 +98,7 @@ class PluginUpdateCommand(AbstractCommandNode):
|
|||||||
|
|
||||||
reply = []
|
reply = []
|
||||||
def closure():
|
def closure():
|
||||||
|
try:
|
||||||
import pkg.utils.context
|
import pkg.utils.context
|
||||||
updated = []
|
updated = []
|
||||||
for key in plugin_list:
|
for key in plugin_list:
|
||||||
@@ -120,6 +121,10 @@ class PluginUpdateCommand(AbstractCommandNode):
|
|||||||
main.reset_logging()
|
main.reset_logging()
|
||||||
|
|
||||||
pkg.utils.context.get_qqbot_manager().notify_admin("已更新插件: {}".format(", ".join(updated)))
|
pkg.utils.context.get_qqbot_manager().notify_admin("已更新插件: {}".format(", ".join(updated)))
|
||||||
|
except Exception as e:
|
||||||
|
logging.error("插件更新失败:{}".format(e))
|
||||||
|
pkg.utils.context.get_qqbot_manager().notify_admin("插件更新失败:{} 请尝试手动更新插件".format(e))
|
||||||
|
|
||||||
|
|
||||||
threading.Thread(target=closure).start()
|
threading.Thread(target=closure).start()
|
||||||
reply = ["[bot]正在更新所有插件,请勿重复发起..."]
|
reply = ["[bot]正在更新所有插件,请勿重复发起..."]
|
||||||
|
|||||||
Reference in New Issue
Block a user