From 8d867d6f23041a981e05580db1fbb2619429fe00 Mon Sep 17 00:00:00 2001 From: Yevheniy Oliynyk Date: Sat, 16 Mar 2024 16:39:42 +0100 Subject: [PATCH] set timeout --- src/main/java/com/crowdin/cli/client/Clients.java | 5 ++++- versions.properties | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/crowdin/cli/client/Clients.java b/src/main/java/com/crowdin/cli/client/Clients.java index 73595db08..2073ee95c 100644 --- a/src/main/java/com/crowdin/cli/client/Clients.java +++ b/src/main/java/com/crowdin/cli/client/Clients.java @@ -11,6 +11,8 @@ public final class Clients { + private static final int TIMEOUT = 30 * 60 * 1000; //30 minĖš + private Clients() {} public static NoClient noClient() { @@ -65,7 +67,7 @@ public static ProjectClient getProjectClient(String apiToken, String baseUrl, lo return new CrowdinProjectClient(client, projectId); } - public static com.crowdin.client.Client prepareClient(String apiToken, String baseUrl) { + private static com.crowdin.client.Client prepareClient(String apiToken, String baseUrl) { boolean isTesting = PropertiesBeanUtils.isUrlForTesting(baseUrl); String organization = PropertiesBeanUtils.getOrganization(baseUrl); Credentials credentials = (isTesting) @@ -74,6 +76,7 @@ public static com.crowdin.client.Client prepareClient(String apiToken, String ba ClientConfig clientConfig = ClientConfig.builder() .jsonTransformer(new JacksonJsonTransformer()) .userAgent(Utils.buildUserAgent()) + .httpTimeoutMs(TIMEOUT) .build(); Utils.proxyHost() .map(pair -> new ClientConfig.Host(pair.getKey(), pair.getValue())) diff --git a/versions.properties b/versions.properties index ec0b3de44..f73b3db98 100644 --- a/versions.properties +++ b/versions.properties @@ -43,7 +43,7 @@ version.commons-io..commons-io=2.14.0 version.commons-cli..commons-cli=1.5.0 -version.com.github.crowdin..crowdin-api-client-java=1.15.0 +version.com.github.crowdin..crowdin-api-client-java=1.15.1 plugin.org.asciidoctor.jvm.convert=3.3.2