aboutsummaryrefslogtreecommitdiff
path: root/app/ui/runview.py
diff options
context:
space:
mode:
authorhistoria <historiavg@proton.me>2026-08-26 00:22:34 -0400
committerhistoria <historiavg@proton.me>2026-08-26 00:22:34 -0400
commit29aa2c8f18516e82429a9e751a74d48284f67e9c (patch)
treeb0dd507f2d3f72f3458add549922cef3561f4b13 /app/ui/runview.py
parent0b8485a5c8a87d3975cf03cd2a4af965848eb030 (diff)
downloadtts-audiobook-generator-29aa2c8f18516e82429a9e751a74d48284f67e9c.tar.gz
fix: stop remote form entries overwriting each other
Diffstat (limited to 'app/ui/runview.py')
-rw-r--r--app/ui/runview.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/ui/runview.py b/app/ui/runview.py
index 60c43b0..7151ecb 100644
--- a/app/ui/runview.py
+++ b/app/ui/runview.py
@@ -338,7 +338,7 @@ class RunView:
return False
if key in (27, ord("q"), 3) and not self.cancelling:
if self._prompt_cancel():
- return
+ return False
finally:
self._monitor_stop.set()
self._cancel.set()
@@ -380,12 +380,14 @@ class RunView:
return False
self.cancelling = True
self._cancel.set()
+ # Wind the worker down BEFORE offering the server stop: killing the
+ # server under a still-running request turns the cancellation into
+ # request failures (reported as "failed" instead of "cancelled").
+ self._worker.join(timeout=60)
# When this run booted the server, offer to shut it down too (the
- # boot path kills it itself when cancelled before ready).
+ # boot path kills it itself when cancelled before ready); by now
+ # the worker is done, so nothing is mid-request.
self._confirm_stop_server()
- # Wait for the worker to wind down so the hub menu shows the real
- # backend state (and the summary screen is drawn at least once).
- self._worker.join(timeout=60)
self._drain()
self.render()
# One more key press acknowledges the final screen.