Proper search query to minimize api calls
回答済みHello,
I'm looking for a way to optimize a box-folder tree walker with the minimum number of api calls. The main objective of the walker is to detect only new or recently modified folders in a large folder structure (~10k of subfolders) so that I can skip unchanged folders with respect to a given date; however, within the current box-python-sdk, I need to call `get()` for every subfolders to check `modified_at`.
This is quite inefficient and takes a lot of time. Imagine only 1 subfolder is modified among 10k. The walker still needs to scan all 10k subfolders. I thought about using `Client.search().query()` but this idea also has two main obstacles:
- parent folder (depth 1) cannot be specified
- query cannot be empty
Any input would be much appreciated!
Thank you.
Kind regards,
Jeongsu
-
正式なコメント
Hi Jeongsu,
The only other way to do this with our existing API endpoints, would be to use the events API. You would basically need to go through the entire folder tree once to get a base line - then monitor the event stream for any future modified, created, of deleted events.
Thanks,
Alex, Box Developer Advocate
コメントアクション
投稿コメントは受け付けていません。
コメント
2件のコメント