[
https://issues.jboss.org/browse/FORGE-2201?page=com.atlassian.jira.plugin...
]
George Gastaldi commented on FORGE-2201:
----------------------------------------
You can use {{ProjectFactory.containsProject()}} instead, and then call findProject
later.
Even though we do cache the projects, your code may be slow when run under 30 projects
because of the facet installation detection algorithm, hence that's why we recommend
using findProject only when you need to use the Project
Fetch all Projects is very slow (>2 mins)
-----------------------------------------
Key: FORGE-2201
URL:
https://issues.jboss.org/browse/FORGE-2201
Project: Forge
Issue Type: Enhancement
Components: Addon Development
Affects Versions: 2.13.0.Final
Reporter: Michael Schwartz
Priority: Trivial
I want to fetch all available projects. The following source works as needed but needs at
least 2 mins until completed (about 30 projects):
protected void setupProjects(UIBuilder builder) {
Project entityProject = getSelectedProject(builder.getUIContext());
Resource<?> resource = entityProject.getRoot().getParent();
allProjects = new HashSet<>();
for (Resource<?> res : resource.listResources()) {
DirectoryResource directory = (DirectoryResource) res.reify(DirectoryResource.class);
if (directory != null) {
Project proj = projectFactory.findProject(directory);
if (proj != null) {
allProjects.add(proj);
}
}
}
}
Is there a faster way to iterate through the projects or maybe some initialization can be
done by "lazy loading"?
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)