Skip to content

Commit

Permalink
Exclude collection projects from portfolio metrics calculation to not…
Browse files Browse the repository at this point in the history
… wrongly influence numbers

Signed-off-by: Ralf King <[email protected]>
  • Loading branch information
rkg-mm committed Apr 22, 2024
1 parent b6d04ba commit 26ed8b6
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,12 @@ private void updateMetrics() throws Exception {

private List<Project> fetchNextActiveProjectsPage(final PersistenceManager pm, final Long lastId) throws Exception {
try (final Query<Project> query = pm.newQuery(Project.class)) {
// exclude collection projects since their numbers are included in other projects and would wrongly influence portfolio metrics.
if (lastId == null) {
query.setFilter("(active == null || active == true)");
query.setFilter("(active == null || active == true) && (collectionLogic == null || collectionLogic == 'NONE')");
} else {
query.setFilter("(active == null || active == true) && id < :lastId");
query.setFilter("(active == null || active == true) && (collectionLogic == null || collectionLogic == 'NONE') " +
"&& id < :lastId");
query.setParameters(lastId);
}
query.setOrdering("id DESC");
Expand Down

0 comments on commit 26ed8b6

Please sign in to comment.