Skip to content

Commit

Permalink
set timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
yevheniyJ committed Mar 16, 2024
1 parent 503a974 commit 8d867d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/main/java/com/crowdin/cli/client/Clients.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

public final class Clients {

private static final int TIMEOUT = 30 * 60 * 1000; //30 min˚

private Clients() {}

public static NoClient noClient() {
Expand Down Expand Up @@ -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)
Expand All @@ -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()))
Expand Down
2 changes: 1 addition & 1 deletion versions.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8d867d6

Please sign in to comment.