diff --git a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/Request.java b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/Request.java index 65dc8af0b9..a7f994cce3 100644 --- a/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/Request.java +++ b/services/git-bridge/src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/Request.java @@ -130,6 +130,7 @@ public abstract class Request { HttpRequest request = Instance.httpRequestFactory.buildGetRequest( new GenericUrl(url) ); + setTimeouts(request); request(request); } catch (IOException e) { e.printStackTrace(); @@ -147,6 +148,7 @@ public abstract class Request { getPostBody().getBytes() ) ); + setTimeouts(request); request(request); } catch (IOException e) { e.printStackTrace(); @@ -159,4 +161,10 @@ public abstract class Request { future = request.executeAsync(); } + private void setTimeouts(HttpRequest request) { + // timeouts are 20s by default + int threeMinutesInMs = 1000 * 60 * 3; + request.setReadTimeout(threeMinutesInMs); + } + }