Skip to content

Commit

Permalink
Merge branch 'main' into grad-release
Browse files Browse the repository at this point in the history
  • Loading branch information
chris.ditcher authored and chris.ditcher committed Aug 29, 2023
2 parents c3bdee0 + da79192 commit a572861
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>ca.bc.gov.educ</groupId>
<artifactId>educ-grad-graduation-report-api</artifactId>
<version>1.8.32</version>
<version>1.8.40</version>
<name>educ-grad-graduation-report-api</name>
<description>Grad Graduation Report API for GRAD team</description>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public WebClient webClient() {
return WebClient.builder().uriBuilderFactory(defaultUriBuilderFactory).exchangeStrategies(ExchangeStrategies.builder()
.codecs(configurer -> configurer
.defaultCodecs()
.maxInMemorySize(40 * 1024 * 1024)) // 40 MB
.maxInMemorySize(100 * 1024 * 1024)) // 100 MB
.build())
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ protected UUID convertStringToGuid(String studentGuid) {
return new UUID(ByteBuffer.wrap(data, 0, 8).getLong(), ByteBuffer.wrap(data, 8, 8).getLong());
}

protected void processReportGradStudentDataTasksAsync(List<Callable<Object>> tasks, List<ReportGradStudentData> result, int numberOfThreads) {
protected void processReportGradStudentDataTasksAsync(List<Callable<Object>> tasks, List<ReportGradStudentData> result) {
if(tasks.isEmpty()) return;
List<Future<Object>> executionResult;
ExecutorService executorService = Executors.newFixedThreadPool(numberOfThreads);
ExecutorService executorService = Executors.newWorkStealingPool();
try {
executionResult = executorService.invokeAll(tasks);
for (Future<?> f : executionResult) {
Expand All @@ -73,6 +74,7 @@ protected void processReportGradStudentDataTasksAsync(List<Callable<Object>> tas
}
} catch (InterruptedException | ExecutionException ex) {
logger.error("Multithreading error during the task execution: {}", ex.getLocalizedMessage());
Thread.currentThread().interrupt();
} finally {
executorService.shutdown();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ private List<ReportGradStudentData> processReportGradStudentDataList(Page<School
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;
Expand Down

0 comments on commit a572861

Please sign in to comment.