fix: 已有数据库再次安装时接上原库而不是报错

This commit is contained in:
2026-10-30 10:31:08 +08:00
parent ea3391af76
commit 613ed3a8c7
5 changed files with 47 additions and 21 deletions
+2 -2
View File
@@ -37,10 +37,10 @@ def install_status() -> dict:
@router.post("/install")
def install(body: dict) -> dict:
try:
perform_install(body)
already = perform_install(body)
except InstallError as exc:
raise _bad(str(exc)) from exc
return {"ok": True}
return {"ok": True, "already": already}
def _bad(message: str, status: int = 400) -> HTTPException: