mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-21 19:50:01 +00:00
extend initial connection timeout from 10s to 10min; for Master Data Import it used to be 60s and even that was close...;
this partly reverts a "refactoring" that was none (938e1e8cbc) which replaced
an explicit 60s timeout with a util call that uses 10s
Change-Id: I1dbda0314550dcc77c7d69c3513d1de8430eae07
This commit is contained in:
1 parent
6eb5b3d191
commit
c3f91ccc4c
1 file changed
+3
-1
@@ -5,6 +5,8 @@ import java.net.HttpURLConnection;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import com.sap.sse.common.Duration;
|
||||
|
||||
public class HttpUrlConnectionHelper {
|
||||
private static final int HTTP_MAX_REDIRECTS = 5;
|
||||
|
||||
@@ -20,7 +22,7 @@ public class HttpUrlConnectionHelper {
|
||||
connection.setRequestProperty("User-Agent", "Mozilla/5.0...");
|
||||
connection.setDoOutput(true);
|
||||
// Initial timeout needs to be big enough to allow the first parts of the response to reach this server
|
||||
connection.setReadTimeout(10000);
|
||||
connection.setReadTimeout((int) Duration.ONE_MINUTE.times(10).asMillis());
|
||||
if (connection.getResponseCode() == HttpURLConnection.HTTP_MOVED_PERM
|
||||
|| connection.getResponseCode() == HttpURLConnection.HTTP_MOVED_TEMP) {
|
||||
String location = connection.getHeaderField("Location");
|
||||
|
||||
Reference in new issue
Block a user