Skip to content

Commit

Permalink
fix: Fix for slow counting of org units for search results.
Browse files Browse the repository at this point in the history
Org units were retrieved from d2 and then counted, but can be counted in d2 and then the number retrieved instead.
This solves long load times for programs with large number of TEIs and org units.
  • Loading branch information
alex-vt committed Sep 19, 2024
1 parent b655ebd commit e25170a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,6 @@ public boolean canCreateInProgramWithoutSearch() {
private boolean displayOrgUnit() {
return d2.organisationUnitModule().organisationUnits()
.byProgramUids(Collections.singletonList(currentProgram))
.blockingGet().size() > 1;
.count().blockingGet() > 1;
}
}

0 comments on commit e25170a

Please sign in to comment.