diff --git a/packages/helpermodules/utils/_thread_handler.py b/packages/helpermodules/utils/_thread_handler.py index 33a108a4ed..50eda1dfee 100644 --- a/packages/helpermodules/utils/_thread_handler.py +++ b/packages/helpermodules/utils/_thread_handler.py @@ -14,13 +14,16 @@ def split_chunks(to_split, n): threads_splitted = list(split_chunks(threads, 50)) for threads_chunk in threads_splitted: + threads_to_keep = [] + for thread in threads_chunk: if is_thread_alive(thread.name): log.error(f"{thread.name} ist bereits aktiv und wird nicht erneut gestartet.") not_finished_threads.append(thread.name) - threads_chunk.remove(thread) + else: + threads_to_keep.append(thread) # Start them all - for thread in threads_chunk: + for thread in threads_to_keep: thread.start() # Wait for all to complete