From 7ff408e845fe7a662c82d1115a5f9798b310b772 Mon Sep 17 00:00:00 2001 From: chettoy Date: Sat, 22 Oct 2022 21:30:37 +0800 Subject: [PATCH] fix: Fix video thread pool early shutdown --- fxxkstar.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/fxxkstar.py b/fxxkstar.py index 05fec31..c3a679e 100644 --- a/fxxkstar.py +++ b/fxxkstar.py @@ -2952,9 +2952,14 @@ def on_done(future: Future): future.add_done_callback(on_done) time.sleep(1.5) + # Dispatch the first task dispatch_task() - while len(future_list) > 0: - future_list[0].result() + # Wait for all processing to be completed + while self.video_to_watch: + while len(future_list) > 0: + future_list[0].result() + # Waiting for task creation + time.sleep(1) thread_pool.shutdown() print(G_STRINGS['sync_video_progress_ended'])