timols / java-gitlab-api

A wrapper for the Gitlab API written in Java
Apache License 2.0
387 stars 317 forks source link

The "connectTimeout" parameter is not configurable #297

Closed shaburov closed 6 years ago

shaburov commented 6 years ago

The URLConnection class has a "connectTimeout" setting that is not represented in the GitlabAPI class. The result is a default wait of 2 minutes, which is not a productive option.

Check easily:

    @Test
    public void unitTest_20180417005924() {
        try {
            System.out.println(new Date());
            GitlabAPI api = GitlabAPI.connect("http://10.1.10.130:10080" ,"blabla");
            api.getVersion();
        } catch (Exception e) {
            System.out.println(new Date());
            System.out.println(e.getMessage());
        }
    }

Result:

Tue Apr 17 01:03:21 MSK 2018
Tue Apr 17 01:05:31 MSK 2018
Connection timed out (Connection timed out)
shaburov commented 6 years ago

https://github.com/timols/java-gitlab-api/pull/298

shaburov commented 6 years ago

Fixed: https://github.com/timols/java-gitlab-api/commit/58b0179c016875b21fd73224b44a12bcf46aec9b