Fixed logs

This commit is contained in:
Luca Frosini 2019-09-26 12:53:16 +02:00
parent f0d86c24cb
commit 8eecba49d4
1 changed files with 9 additions and 5 deletions

View File

@ -42,6 +42,10 @@ public class SmartExecutorClientImpl implements SmartExecutorClient {
protected String host;
protected String address;
public static String getHostFromCompleteURL(String address) {
return address.split("(http)s{0,1}://")[1].split(":")[0];
}
@Override
public String getHost() {
return host;
@ -53,7 +57,7 @@ public class SmartExecutorClientImpl implements SmartExecutorClient {
public void setAddress(String address) {
this.address = address;
this.host = address.split("(http)s{0,1}://")[1].split(":")[0];
this.host = getHostFromCompleteURL(address);
}
public String getPluginName() {
@ -151,7 +155,7 @@ public class SmartExecutorClientImpl implements SmartExecutorClient {
private String getScheduledTask(String name) {
try {
logger.info("Going to get orphan scheduled tasks");
logger.info("Going to get {} scheduled tasks", name);
GXHTTPStringRequest gxHTTPStringRequest = GXHTTPStringRequest.newRequest(address);
gxHTTPStringRequest.from(SmartExecutorClient.class.getSimpleName());
@ -161,11 +165,11 @@ public class SmartExecutorClientImpl implements SmartExecutorClient {
gxHTTPStringRequest.path(RestConstants.EXECUTIONS_PATH_PART);
HttpURLConnection httpURLConnection = gxHTTPStringRequest.get();
String orphanList = parseHttpURLConnection(httpURLConnection);
String scheduledList = parseHttpURLConnection(httpURLConnection);
logger.info("Orphan schadule task are {}", orphanList);
logger.info("{} scheduled task are {}", name, scheduledList);
return orphanList;
return scheduledList;
} catch(WebApplicationException e) {
throw e;
} catch(Exception e) {