mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #48 from overleaf/sk-extend-request-timeouts
Extend http request timeouts
This commit is contained in:
commit
8e25bbf61a
1 changed files with 8 additions and 0 deletions
|
@ -130,6 +130,7 @@ public abstract class Request<T extends Result> {
|
|||
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<T extends Result> {
|
|||
getPostBody().getBytes()
|
||||
)
|
||||
);
|
||||
setTimeouts(request);
|
||||
request(request);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
|
@ -159,4 +161,10 @@ public abstract class Request<T extends Result> {
|
|||
future = request.executeAsync();
|
||||
}
|
||||
|
||||
private void setTimeouts(HttpRequest request) {
|
||||
// timeouts are 20s by default
|
||||
int threeMinutesInMs = 1000 * 60 * 3;
|
||||
request.setReadTimeout(threeMinutesInMs);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue