From 74d319c0bc41660dc59de3cc31f7e564ed6d887e Mon Sep 17 00:00:00 2001 From: Alon Burg Date: Fri, 13 Sep 2024 13:23:02 +0300 Subject: [PATCH] fix bucket worker not waiting for all queue worker to finish --- helpers/metadata/backends/base.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/helpers/metadata/backends/base.py b/helpers/metadata/backends/base.py index 76e4984e..5b9bc0ce 100644 --- a/helpers/metadata/backends/base.py +++ b/helpers/metadata/backends/base.py @@ -257,7 +257,11 @@ def compute_aspect_ratio_bucket_indices(self, ignore_existing_cache: bool = Fals ncols=100, miniters=int(len(new_files) / 100), ) as pbar: - while any(worker.is_alive() for worker in workers): + while any(worker.is_alive() for worker in workers) or \ + not tqdm_queue.empty() or \ + not aspect_ratio_bucket_indices_queue.empty() or \ + not metadata_updates_queue.empty() or \ + not written_files_queue.empty(): current_time = time.time() while not tqdm_queue.empty(): pbar.update(tqdm_queue.get())