Skip to content

Commit

Permalink
[JENKINS-71354] Make request timeouts configurable for Bitbucket Clou…
Browse files Browse the repository at this point in the history
…d API Client (#709)

Co-authored-by: Günter Grodotzki <gunter@grodotzki.com>
  • Loading branch information
Dohbedoh and lifeofguenter committed May 30, 2023
1 parent dea1bda commit d9c5e84
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -858,9 +858,12 @@ protected CloseableHttpResponse executeMethod(HttpHost host, HttpRequestBase htt
}

RequestConfig.Builder requestConfig = RequestConfig.custom();
requestConfig.setConnectTimeout(10 * 1000);
requestConfig.setConnectionRequestTimeout(60 * 1000);
requestConfig.setSocketTimeout(60 * 1000);
String connectTimeout = System.getProperty("http.connect.timeout", "10");

Check warning on line 861 in src/main/java/com/cloudbees/jenkins/plugins/bitbucket/client/BitbucketCloudApiClient.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 861 is not covered by tests
requestConfig.setConnectTimeout(Integer.parseInt(connectTimeout) * 1000);

Check warning on line 862 in src/main/java/com/cloudbees/jenkins/plugins/bitbucket/client/BitbucketCloudApiClient.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 862 is not covered by tests
String connectionRequestTimeout = System.getProperty("http.connect.request.timeout", "60");

Check warning on line 863 in src/main/java/com/cloudbees/jenkins/plugins/bitbucket/client/BitbucketCloudApiClient.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 863 is not covered by tests
requestConfig.setConnectionRequestTimeout(Integer.parseInt(connectionRequestTimeout) * 1000);

Check warning on line 864 in src/main/java/com/cloudbees/jenkins/plugins/bitbucket/client/BitbucketCloudApiClient.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 864 is not covered by tests
String socketTimeout = System.getProperty("http.socket.timeout", "60");

Check warning on line 865 in src/main/java/com/cloudbees/jenkins/plugins/bitbucket/client/BitbucketCloudApiClient.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 865 is not covered by tests
requestConfig.setSocketTimeout(Integer.parseInt(socketTimeout) * 1000);

Check warning on line 866 in src/main/java/com/cloudbees/jenkins/plugins/bitbucket/client/BitbucketCloudApiClient.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 866 is not covered by tests
httpMethod.setConfig(requestConfig.build());

CloseableHttpResponse response = client.execute(host, httpMethod, requestContext);
Expand Down

0 comments on commit d9c5e84

Please sign in to comment.