中控更新改为先同步 git pull 再重启,并修复前端已是最新时一直显示更新中。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
dekun
2026-10-04 07:56:06 +08:00
parent 04c750f2dd
commit ea24149a55
4 changed files with 122 additions and 80 deletions
+2 -1
View File
@@ -541,7 +541,8 @@ def api_hub_self_update():
from lib.update_lib import schedule_pull_and_restart
try:
result = schedule_pull_and_restart(delay_seconds=2.0)
# 同步 pull + 延迟重启;timeout 留给 git pull
result = schedule_pull_and_restart(delay_seconds=1.2)
except Exception as e:
result = {"ok": False, "msg": f"触发更新异常: {e}", "deferred": False}
return jsonify(result), (200 if result.get("ok") else 400)