Skip to content

Commit

Permalink
Use PreferencesData.getInteger when applicable
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Dec 20, 2021
1 parent 66a973a commit c16b9f5
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,15 @@ public class HttpConnectionManager {
userAgent = PreferencesData.get("http.user_agent", defaultUserAgent);
int connectTimeoutFromConfig = 5000;
try {
connectTimeoutFromConfig =
Integer.parseInt(
PreferencesData.get("http.connection_timeout_ms", "5000"));
connectTimeoutFromConfig = PreferencesData.getInteger("http.connection_timeout_ms", 5000);
} catch (NumberFormatException e) {
System.err.println("Error parsing http.connection_timeout_ms config: " + e.getMessage());
}
connectTimeout = connectTimeoutFromConfig;
// Set by default 20 max redirect to follow
int maxRedirectNumberConfig = 20;
try {
maxRedirectNumberConfig =
Integer.parseInt(
PreferencesData.get("http.max_redirect_number", "20"));
maxRedirectNumberConfig = PreferencesData.getInteger("http.max_redirect_number", 20);
} catch (NumberFormatException e) {
System.err.println("Error parsing http.max_redirect_number config: " + e.getMessage());
}
Expand Down

0 comments on commit c16b9f5

Please sign in to comment.