From 698c28467e75c45a8e0970a63645b3c5778128a6 Mon Sep 17 00:00:00 2001 From: Justin Bollinger Date: Fri, 24 Apr 2026 23:40:29 -0400 Subject: [PATCH] fix(api): move q.task_done() to finally block in Weakpass worker The worker() function inside fetch_all_weakpass_wordlists_multithreaded() called q.task_done() inside the except block. If the except block itself throws (e.g., KeyboardInterrupt during print), task_done() is skipped and q.join() hangs forever. Move task_done() to a finally block to ensure it always runs, allowing the queue manager to correctly track completion even if error handling itself fails. Co-Authored-By: Claude Sonnet 4.6 --- hate_crack/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hate_crack/api.py b/hate_crack/api.py index b4ea7b2..4a1d2e2 100644 --- a/hate_crack/api.py +++ b/hate_crack/api.py @@ -429,7 +429,8 @@ def fetch_all_weakpass_wordlists_multithreaded(total_pages=None, threads=10): wordlists.extend(entries) except Exception as e: print(f"Error fetching page {page}: {e}") - q.task_done() + finally: + q.task_done() start_page = 2 if entries1 else 1 for page in range(start_page, total_pages + 1):