Java Folder.getChildren api is taking over 20 second and causes timeout issue
CompletedHi team, I am fetching a folder with java API and I am facing a timeout issue with folder.getChildren(["fieldnames"]) which is taking over 20 seconds to iterate over the 3 files that a folder is containing. I set up the rate limit by 1 qps or 5 qps, the result is the same. Is there a way to speed that up? or do you have some ideas for improving?
This folder will contain over 1000 subfolders in production environment, I notice that the default value for the getChildren is 1000. How could I iterator the whole folder efficiently?
public Iterable<BoxItem.Info> getChildren(final String... fields) {
return () -> {
String queryString = new QueryStringBuilder().appendParam("fields", fields).toString();
URL url = GET_ITEMS_URL.buildWithQuery(getAPI().getBaseURL(), queryString, getID());
return new BoxItemIterator(getAPI(), url, marker(DEFAULT_LIMIT));
};
}
return () -> {
String queryString = new QueryStringBuilder().appendParam("fields", fields).toString();
URL url = GET_ITEMS_URL.buildWithQuery(getAPI().getBaseURL(), queryString, getID());
return new BoxItemIterator(getAPI(), url, marker(DEFAULT_LIMIT));
};
}
Please sign in to leave a comment.
Comments
1 comment