perf: 自动更新时的异常处理

This commit is contained in:
Rock Chin
2023-01-02 12:54:38 +08:00
parent 3b5bc5e857
commit 27dbd470a7
3 changed files with 11 additions and 3 deletions

View File

@@ -167,7 +167,11 @@ def process_message(launcher_type: str, launcher_id: int, text_message: str, mes
threading.Thread(target=reload_task, daemon=True).start()
elif cmd == 'update' and launcher_type == 'person' and launcher_id == config.admin_qq:
def update_task():
pkg.utils.updater.update_all()
try:
pkg.utils.updater.update_all()
except Exception as e0:
pkg.utils.context.get_qqbot_manager().notify_admin("更新失败:{}".format(e0))
return
pkg.utils.reloader.reload_all()
threading.Thread(target=update_task, daemon=True).start()