diff --git a/api/pom.xml b/api/pom.xml index e570757b..1ec385f4 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -6,7 +6,7 @@ ca.bc.gov.educ educ-grad-student-api - 1.8.42 + 1.8.44 educ-grad-student-api Student Demographics API for GRAD team diff --git a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GradStudentReportService.java b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GradStudentReportService.java index e960ff0a..6ea9278e 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GradStudentReportService.java +++ b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GradStudentReportService.java @@ -99,17 +99,17 @@ private List createAndExecuteReportGradStudentDataTasks(S tasks.add(pageTask); } - processReportGradStudentDataTasksAsync(tasks, result, totalNumberOfPages); + processReportGradStudentDataTasksAsync(tasks, result); } logger.debug("Completed in {} sec, total objects acquired {}", (System.currentTimeMillis() - startTime) / 1000, result.size()); return result; } @Generated - private void processReportGradStudentDataTasksAsync(List> tasks, List result, int numberOfThreads) { + private void processReportGradStudentDataTasksAsync(List> tasks, List result) { if(tasks.isEmpty()) return; List> executionResult; - ExecutorService executorService = Executors.newFixedThreadPool(numberOfThreads); + ExecutorService executorService = Executors.newWorkStealingPool(); try { executionResult = executorService.invokeAll(tasks); for (Future f : executionResult) { diff --git a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GraduationStatusService.java b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GraduationStatusService.java index 80ef81a9..cc942df2 100644 --- a/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GraduationStatusService.java +++ b/api/src/main/java/ca/bc/gov/educ/api/gradstudent/service/GraduationStatusService.java @@ -1038,16 +1038,16 @@ private List processStudentDataList(Page studentGuids) { tasks.add(pageTask); } - processUUIDDataTasksAsync(tasks, result, totalNumberOfPages); + processUUIDDataTasksAsync(tasks, result); } logger.debug("Completed in {} sec, total objects aquared {}", (System.currentTimeMillis() - startTime) / 1000, result.size()); return result; } - private void processUUIDDataTasksAsync(List> tasks, List result, int totalNumberOfPages) { + private void processUUIDDataTasksAsync(List> tasks, List result) { if(tasks.isEmpty()) return; List> executionResult; - ExecutorService executorService = Executors.newFixedThreadPool(totalNumberOfPages); + ExecutorService executorService = Executors.newWorkStealingPool(); try { executionResult = executorService.invokeAll(tasks); for (Future f : executionResult) {