taskadapter / redmine-java-api

Redmine Java API
Apache License 2.0
269 stars 162 forks source link

Request timeout? #332

Closed Sir-Will closed 4 years ago

Sir-Will commented 4 years ago

What would be the best way to add a timeout when the redmine site is not reachable? This api doesn't seem to have a implementation of timeout.

alexeyOnGitHub commented 4 years ago

timeouts are outside of the scope of this library because they are typically handled by http client layer. you can set timeouts when creating an instance of HttpClient before providing it to the library:

    public static RedmineManager createWithApiKey(String uri,
                                                  String apiAccessKey, HttpClient httpClient) {
        return new RedmineManager(new Transport(new URIConfigurator(uri,
                apiAccessKey), httpClient));
    }