diff --git a/build.gradle b/build.gradle index 94dba8e..74970a7 100644 --- a/build.gradle +++ b/build.gradle @@ -52,7 +52,7 @@ configurations { } // Set increased lower and upper limits for the java-execution. -tasks.withType(JavaExec) { +tasks.withType(JavaExec).configureEach { jvmArgs = ['-Xms512m', '-Xmx8g'] } diff --git a/installAndRun.sh b/installAndRun.sh index b5768a9..ddf21c9 100755 --- a/installAndRun.sh +++ b/installAndRun.sh @@ -1,4 +1,5 @@ # This script installs and runs the project. +# It also sets the "max-heap-size", depending on the machine's memory. # For error-handling, we cannot use the "set -e" since: it has problems https://mywiki.wooledge.org/BashFAQ/105 # So we have our own function, for use when a single command fails. diff --git a/src/main/java/eu/openaire/urls_worker/util/AssignmentsHandler.java b/src/main/java/eu/openaire/urls_worker/util/AssignmentsHandler.java index a9f0bb5..72120be 100644 --- a/src/main/java/eu/openaire/urls_worker/util/AssignmentsHandler.java +++ b/src/main/java/eu/openaire/urls_worker/util/AssignmentsHandler.java @@ -38,7 +38,7 @@ public class AssignmentsHandler { private static String requestUrl; private static final Duration requestConnectTimeoutDuration = Duration.ofMinutes(1); // 1 minute. - private static final Duration requestReadTimeoutDuration = Duration.ofHours(3); // 3 hours. Time to wait for the data to get transferred over the network. Many workers may try to get assignments from the Worker, so each worker might have to wait some 10s of minutes for work. + private static final Duration requestReadTimeoutDuration = Duration.ofHours(5); // 5 hours. Time to wait for the data to get transferred over the network. Many workers may try to get assignments from the Worker, so each worker might have to wait some 10s of minutes for work. // The controller has to retrieve the data from the database, then prepare them in memory, insert them in the "assignment"-table and, finally, return them to the worker. public static final RestTemplate restTemplate = new RestTemplateBuilder().setConnectTimeout(requestConnectTimeoutDuration).setReadTimeout(requestReadTimeoutDuration).build();