From 9ea99eb6881f59c483de60822322b75dae315935 Mon Sep 17 00:00:00 2001 From: SuperDumbTM <71750702+SuperDumbTM@users.noreply.github.com> Date: Sun, 27 Aug 2023 20:07:02 +0800 Subject: [PATCH] fix: non-blocking exec for manual & retry install --- src/install/task_manager.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/install/task_manager.py b/src/install/task_manager.py index 3761d9d..cec2465 100644 --- a/src/install/task_manager.py +++ b/src/install/task_manager.py @@ -89,7 +89,7 @@ def manual_install(self): for task in (t for t in self.tasks if t.status == ExecuteStatus.PENDING): self.qsig_msg.emit(f"開始安裝 {task.name} (手動模式)") try: - task.execute(no_options=True) + Thread(target=task.execute, args=(True,), daemon=False).start() except Exception as e: self.qsig_msg.emit(f"{e} ({task.name})") @@ -108,7 +108,10 @@ def retry_install(self, no_options: bool = True): continue self.qsig_msg.emit(f"開始重試 {task.name} (手動模式)") try: - task.execute(no_options=no_options) + Thread( + target=task.execute, + args=(no_options,), + daemon=False).start() except Exception as e: self.qsig_msg.emit(f"{e} ({task.name})")