Skip to content

Commit

Permalink
Getting reports list from storage (#3025)
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonioG70 authored Dec 6, 2023
1 parent a637aff commit 5fcd9fb
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.roda.core.data.common.RodaConstants;
import org.roda.core.data.exceptions.AuthorizationDeniedException;
import org.roda.core.data.exceptions.GenericException;
import org.roda.core.data.exceptions.NotFoundException;
import org.roda.core.data.exceptions.NotificationException;
import org.roda.core.data.exceptions.RequestNotValidException;
import org.roda.core.data.v2.index.filter.Filter;
Expand Down Expand Up @@ -94,13 +95,18 @@ public void notify(ModelService model, IndexService index, Job job, JobStats job
StringBuilder builder = new StringBuilder();

for (IndexedReport report : reports) {
Report last = report.getReports().get(report.getReports().size() - 1);
builder.append(last.getPluginDetails()).append("\n\n");
List<Report> reportsList = model.retrieveJobReport(report.getJobId(), report.getId()).getReports();
if (reportsList != null && !reportsList.isEmpty()) {
Report last = reportsList.get(reportsList.size() - 1);
builder.append(last.getPluginDetails()).append("\n\n");
}
}

scopes.put("failures", new Handlebars.SafeString(builder.toString()));
} catch (IOException e) {
LOGGER.error("Error getting failed reports", e);
} catch (NotFoundException e) {
LOGGER.error("Error getting reports list", e);
}
}

Expand Down

0 comments on commit 5fcd9fb

Please sign in to comment.