Increase HTTP timeouts.
This commit is contained in:
parent
b148876391
commit
7c1c9b2fe1
|
@ -1,3 +1,3 @@
|
||||||
id = hmci
|
id = hmci
|
||||||
group = biz.nellemann.hmci
|
group = biz.nellemann.hmci
|
||||||
version = 1.1.4
|
version = 1.1.5
|
||||||
|
|
|
@ -28,7 +28,6 @@ import java.util.concurrent.Callable;
|
||||||
|
|
||||||
@Command(name = "hmci",
|
@Command(name = "hmci",
|
||||||
mixinStandardHelpOptions = true,
|
mixinStandardHelpOptions = true,
|
||||||
description = "HMC Insights.",
|
|
||||||
versionProvider = biz.nellemann.hmci.VersionProvider.class)
|
versionProvider = biz.nellemann.hmci.VersionProvider.class)
|
||||||
public class Application implements Callable<Integer> {
|
public class Application implements Callable<Integer> {
|
||||||
|
|
||||||
|
@ -59,11 +58,9 @@ public class Application implements Callable<Integer> {
|
||||||
|
|
||||||
switch (enableDebug.length) {
|
switch (enableDebug.length) {
|
||||||
case 1:
|
case 1:
|
||||||
System.out.println("DEBUG");
|
|
||||||
System.setProperty(SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "DEBUG");
|
System.setProperty(SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "DEBUG");
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
System.out.println("TRACE");
|
|
||||||
System.setProperty(SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "TRACE");
|
System.setProperty(SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "TRACE");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,9 +50,9 @@ public class HmcRestClient {
|
||||||
private final OkHttpClient client;
|
private final OkHttpClient client;
|
||||||
|
|
||||||
// OkHttpClient timeouts
|
// OkHttpClient timeouts
|
||||||
private final static int CONNECT_TIMEOUT = 15;
|
private final static int CONNECT_TIMEOUT = 30;
|
||||||
private final static int WRITE_TIMEOUT = 15;
|
private final static int WRITE_TIMEOUT = 30;
|
||||||
private final static int READ_TIMEOUT = 15;
|
private final static int READ_TIMEOUT = 30;
|
||||||
|
|
||||||
private final String baseUrl;
|
private final String baseUrl;
|
||||||
private final String username;
|
private final String username;
|
||||||
|
@ -117,7 +117,7 @@ public class HmcRestClient {
|
||||||
log.error("login() - URL Error: " + e.getMessage());
|
log.error("login() - URL Error: " + e.getMessage());
|
||||||
throw e;
|
throw e;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("login() - Error", e);
|
log.error("login() - Error: " + e.getMessage());
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -409,6 +409,9 @@ public class HmcRestClient {
|
||||||
private String sendGetRequest(URL url) throws Exception {
|
private String sendGetRequest(URL url) throws Exception {
|
||||||
|
|
||||||
log.trace("getResponse() - " + url.toString());
|
log.trace("getResponse() - " + url.toString());
|
||||||
|
if(authToken == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url(url)
|
.url(url)
|
||||||
|
@ -448,6 +451,9 @@ public class HmcRestClient {
|
||||||
public String sendPostRequest(URL url, String payload) throws Exception {
|
public String sendPostRequest(URL url, String payload) throws Exception {
|
||||||
|
|
||||||
log.trace("sendPostRequest() - " + url.toString());
|
log.trace("sendPostRequest() - " + url.toString());
|
||||||
|
if(authToken == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
RequestBody requestBody;
|
RequestBody requestBody;
|
||||||
if(payload != null) {
|
if(payload != null) {
|
||||||
|
|
Loading…
Reference in a new issue