Skip to content

Commit

Permalink
Merge pull request #521 from bcgov/develop/alex-GRAD2-2817
Browse files Browse the repository at this point in the history
GRAD2-2817
  • Loading branch information
arybakov-cgi authored Sep 4, 2024
2 parents 04fa7dd + c2f540a commit 9838576
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public Map<String, ExecutionContext> partition(int gridSize) {
long startTime = System.currentTimeMillis();
logger.debug("Filter Schools for deleting student reports");
boolean processAllReports = "ALL".equalsIgnoreCase(searchRequest.getActivityCode());
int quantity = ((searchRequest.getQuantity() == null) || (searchRequest.getQuantity() == 0)) ? DEFAULT_ROW_COUNT : searchRequest.getQuantity();
Long batchId = jobExecution.getId();;
List<String> eligibleStudentSchoolDistricts = gradSchoolOfRecordFilter.filterSchoolOfRecords(searchRequest);
List<String> finalSchoolDistricts = eligibleStudentSchoolDistricts.stream().sorted().toList();
Expand All @@ -68,7 +67,7 @@ public Map<String, ExecutionContext> partition(int gridSize) {
if(processAllReports) {
for(String reportType: searchRequest.getReportTypes()) {
Long studentReportsCount = restUtils.getTotalReportsForProcessing(List.of(), reportType, distributionSummaryDTO);
Integer guidsRowCount = Integer.min(studentReportsCount.intValue(), quantity);
Integer guidsRowCount = Integer.min(studentReportsCount.intValue(), DEFAULT_ROW_COUNT);
totalStudentReportsCount += guidsRowCount;
updateBatchJobHistory(algorithmJobHistory, totalStudentReportsCount);
List<UUID> reportTypeGuids = restUtils.getReportStudentIDsByStudentIDsAndReportType(List.of(), reportType, guidsRowCount, distributionSummaryDTO);
Expand All @@ -80,7 +79,7 @@ public Map<String, ExecutionContext> partition(int gridSize) {
if(!studentGuidsBySearch.isEmpty()) {
for (String reportType : searchRequest.getReportTypes()) {
Long studentReportsCount = restUtils.getTotalReportsForProcessing(studentGuidsBySearchString, reportType, distributionSummaryDTO);
Integer guidsRowCount = Integer.min(studentReportsCount.intValue(), quantity);
Integer guidsRowCount = Integer.min(studentReportsCount.intValue(), DEFAULT_ROW_COUNT);
totalStudentReportsCount += guidsRowCount;
updateBatchJobHistory(algorithmJobHistory, totalStudentReportsCount);
List<UUID> reportTypeGuids = restUtils.getReportStudentIDsByStudentIDsAndReportType(studentGuidsBySearchString, reportType, guidsRowCount, distributionSummaryDTO);
Expand Down

0 comments on commit 9838576

Please sign in to comment.