You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I'm using client.public_folders_root.walk() in my FastAPI endpoint it blocks all other requests until walk() has completed its work (usually it takes 5-10 minutes).
It takes 5-10 minutes to enter in the loop, example:
# processes for a long time before the cycleforfolderinclient.account.public_folders_root.walk():
# entered the loopprint(folder.name)
But after entering the loop everything is ok.
I tried to use await to_thread(client.public_folders_root.walk) but it blocks anyway. How can I add it to the async thread or process not the whole walk() but chunks?
walk() is not a generator, which is why you have to wait until all subfolders have been collected. It's not trivial to change that, but dive into _walk() and try to change it, if you're comfortable with diving into exchangelib code.
The reason is especially slow for public folders is that deep searching in public folders is not supported by EWS, so we have to send one API call for every subfolder in the folder hierachy.
When I'm using client.public_folders_root.walk() in my FastAPI endpoint it blocks all other requests until walk() has completed its work (usually it takes 5-10 minutes).
It takes 5-10 minutes to enter in the loop, example:
But after entering the loop everything is ok.
I tried to use await to_thread(client.public_folders_root.walk) but it blocks anyway. How can I add it to the async thread or process not the whole walk() but chunks?
My ExchangeClient code:
The text was updated successfully, but these errors were encountered: