From ffe86b10921b76731b9c8ee36777b3da01e59171 Mon Sep 17 00:00:00 2001 From: Daviemukungi Date: Fri, 25 Aug 2023 12:55:02 +0300 Subject: [PATCH] BS-178 | Increased default tomcat timeout (#84) * BS-178 | Increased API request timeout to 30 minutes * BS-178 | Increased API request timeout to 10 minutes * BS-178 | Adding timeout to tomcat * BS-178 | Siva, Vijay , David | Increased tomcat timeout to 10 minutes * Removed unused imports * BS-178 | Set OpenMRS connection properties to defaults --------- Co-authored-by: Siva Reddy --- package/docker/bahmni-reports/Dockerfile | 2 +- .../bahmni/reports/template/TSIntegrationDiagnosisService.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/package/docker/bahmni-reports/Dockerfile b/package/docker/bahmni-reports/Dockerfile index 2302fce3..511a1cc8 100644 --- a/package/docker/bahmni-reports/Dockerfile +++ b/package/docker/bahmni-reports/Dockerfile @@ -4,7 +4,7 @@ ENV SERVER_PORT=8051 ENV BASE_DIR=/var/run/bahmni-reports ENV CONTEXT_PATH=/bahmnireports ENV WAR_DIRECTORY=/var/run/bahmni-reports/bahmni-reports -ENV SERVER_OPTS="-Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m" +ENV SERVER_OPTS="-Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m -Dsun.net.client.defaultConnectTimeout=600000 -Dsun.net.client.defaultReadTimeout=600000" ENV DEBUG_OPTS="-agentlib:jdwp=transport=dt_socket,address=8003,server=y,suspend=n" RUN mkdir -p /var/log/bahmni-reports diff --git a/src/main/java/org/bahmni/reports/template/TSIntegrationDiagnosisService.java b/src/main/java/org/bahmni/reports/template/TSIntegrationDiagnosisService.java index ca69240d..9cc4afa3 100644 --- a/src/main/java/org/bahmni/reports/template/TSIntegrationDiagnosisService.java +++ b/src/main/java/org/bahmni/reports/template/TSIntegrationDiagnosisService.java @@ -50,7 +50,6 @@ default void loadTempTable(Connection connection, String tempTableName, String p Statement statement = connection.createStatement(); statement.execute(createSqlStmt); try (PreparedStatement pstmtInsert = connection.prepareStatement(insertSqlStmt)) { - TSPageObject pageObject = null; do { pageObject = fetchDescendantsByPagination(parentCode, pageSize, offset, "en", httpClient, descendantsUrlTemplate); @@ -83,7 +82,7 @@ default TSPageObject fetchDescendantsByPagination(String terminologyCode, int pa default int getDefaultPageSize(Properties tsProperties) { String pageSize = System.getenv("REPORTS_TS_PAGE_SIZE"); - if (pageSize == null) pageSize = tsProperties.getProperty("ts.defaultPageSize"); + if (pageSize == null) pageSize = tsProperties.getProperty("terminologyServer.defaultPageSize"); if (pageSize != null) { return Integer.parseInt(pageSize); }