aboutsummaryrefslogtreecommitdiff
path: root/app/backends/qwen.py
diff options
context:
space:
mode:
Diffstat (limited to 'app/backends/qwen.py')
-rw-r--r--app/backends/qwen.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/app/backends/qwen.py b/app/backends/qwen.py
index cc84f8e..33e7114 100644
--- a/app/backends/qwen.py
+++ b/app/backends/qwen.py
@@ -354,8 +354,12 @@ def uninstall(*, emit=None, cancel=None) -> int:
so pip is never killed mid-run. Returns the exit code (130 when
cancelled before pip ran).
"""
- servers.stop("qwen-custom")
- servers.stop("qwen-clone")
+ for name in ("qwen-custom", "qwen-clone"):
+ # Only stop when a pid file exists: without one this tool never
+ # started the server, so the "not started by this tool" notice
+ # would be uninstall-time noise.
+ if servers.pid_for(name) is not None:
+ servers.stop(name)
if common.cancel_requested(cancel):
return 130
rc = common.pip_uninstall([QWEN_PIP_PKG], emit=emit)
@@ -364,7 +368,7 @@ def uninstall(*, emit=None, cancel=None) -> int:
f"{QWEN_PIP_PKG} from the managed venv manually")
else:
print(f"[OK] {QWEN_PIP_PKG} removed.")
- return 0
+ return rc
def main() -> int: