fix: use async thread in list files (#6754)
This commit is contained in:
parent
3940e8a94a
commit
8c7eb57fd0
1 changed files with 5 additions and 1 deletions
|
|
@ -88,7 +88,11 @@ class LocalStorageService(StorageService):
|
|||
msg = f"Flow {flow_id} directory does not exist."
|
||||
raise FileNotFoundError(msg)
|
||||
|
||||
files = [file.name async for file in anyio.Path(folder_path).iterdir() if await anyio.Path(file).is_file()]
|
||||
files = [
|
||||
file.name
|
||||
async for file in await anyio.to_thread.run_sync(folder_path.iterdir)
|
||||
if await anyio.Path(file).is_file()
|
||||
]
|
||||
|
||||
logger.info(f"Listed {len(files)} files in flow {flow_id}.")
|
||||
return files
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue