Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: set timeout #734

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading