From c1ff11d18dcf8ff565816d515314705989eb568e Mon Sep 17 00:00:00 2001 From: dazedanon Date: Sat, 8 Nov 2025 12:40:15 -0600 Subject: [PATCH] Force 1 worker for all estimates --- gui/translation_tab.py | 3 ++- modules/main.py | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gui/translation_tab.py b/gui/translation_tab.py index 7f822a1..16e5d95 100644 --- a/gui/translation_tab.py +++ b/gui/translation_tab.py @@ -414,7 +414,8 @@ class TranslationWorker(QThread): total_cost = "Success" else: # Default behavior: run each file in a separate process (unchanged) - max_workers = threads + # Use single worker for estimate mode to prevent race conditions + max_workers = 1 if self.estimate_only else threads self.executor = ThreadPoolExecutor(max_workers=max_workers) # Submit tasks to run modules in separate processes diff --git a/modules/main.py b/modules/main.py index 160d4cc..6da382c 100644 --- a/modules/main.py +++ b/modules/main.py @@ -178,7 +178,10 @@ files to translate are in the /files folder and that you picked the right game e pass except Exception: pass - with ThreadPoolExecutor(max_workers=THREADS) as executor: + + # Use single worker for estimate mode to prevent race conditions + max_workers = 1 if estimate else THREADS + with ThreadPoolExecutor(max_workers=max_workers) as executor: futures = [] files_root = "files"