From d6ba7ed4db54e5755ffe86729925aa948d63e503 Mon Sep 17 00:00:00 2001 From: "Alex \"mcmonkey\" Goodwin" Date: Thu, 19 Sep 2024 02:05:49 +0900 Subject: [PATCH] oops, fix sloppy refactor "refactor right before committing" the whiskey said, "it'll be fine" it said. woopsie. --- folder_paths.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/folder_paths.py b/folder_paths.py index e05c12595..6abc573d3 100644 --- a/folder_paths.py +++ b/folder_paths.py @@ -213,14 +213,17 @@ def recursive_search(directory: str, excluded_dir_names: list[str] | None=None) relative_path = os.path.relpath(file, directory) result.append(relative_path) return - for subdir in aiofiles.os.listdir(file): + for subdir in await aiofiles.os.listdir(file): path = os.path.join(file, subdir) if subdir not in excluded_dir_names: calls.append(handle(path)) calls.append(proc_subdir(path)) + calls.append(handle(directory)) - future = asyncio.gather(*calls) - asyncio.get_event_loop().run_until_complete(future) + while len(calls) > 0: + future = asyncio.gather(*calls) + calls = [] + asyncio.get_event_loop().run_until_complete(future) asyncio.get_event_loop().close() thread = threading.Thread(target=proc_thread)