diff --git a/README.md b/README.md index 6e84b74..695bd84 100644 --- a/README.md +++ b/README.md @@ -107,7 +107,7 @@ Use the gradle build tool, which will download all required dependencies: Start the InfluxDB container: - docker run --name=influxdb --rm -d -p 8086:8086 influxdb + docker run --name=influxdb --rm -d -p 8086:8086 influxdb:1.8-alpine To execute the Influx client from within the container: diff --git a/build.gradle b/build.gradle index 79d9420..f20dde4 100644 --- a/build.gradle +++ b/build.gradle @@ -19,7 +19,7 @@ dependencies { annotationProcessor 'info.picocli:picocli-codegen:4.6.1' implementation 'info.picocli:picocli:4.6.1' implementation 'org.jsoup:jsoup:1.13.1' - implementation 'com.squareup.okhttp3:okhttp:4.9.0' + implementation 'com.squareup.okhttp3:okhttp:4.9.1' implementation 'com.squareup.moshi:moshi:1.11.0' implementation 'com.serjltt.moshi:moshi-lazy-adapters:2.2' implementation 'org.tomlj:tomlj:1.0.0' @@ -27,9 +27,9 @@ dependencies { implementation 'org.slf4j:slf4j-api:1.7.30' implementation 'org.slf4j:slf4j-simple:1.7.30' - testImplementation('org.spockframework:spock-core:2.0-M4-groovy-3.0') - testImplementation('com.squareup.okhttp3:mockwebserver:4.9.0') - testImplementation("org.slf4j:slf4j-simple:1.7.+") + testImplementation 'org.spockframework:spock-core:2.0-M4-groovy-3.0' + testImplementation 'com.squareup.okhttp3:mockwebserver:4.9.1' + testImplementation "org.slf4j:slf4j-simple:1.7.30" } application { diff --git a/src/main/java/biz/nellemann/hmci/HmcInstance.java b/src/main/java/biz/nellemann/hmci/HmcInstance.java index c52c751..564bb29 100644 --- a/src/main/java/biz/nellemann/hmci/HmcInstance.java +++ b/src/main/java/biz/nellemann/hmci/HmcInstance.java @@ -19,6 +19,7 @@ import biz.nellemann.hmci.Configuration.HmcObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import java.io.IOException; import java.time.Duration; import java.time.Instant; import java.util.HashMap; @@ -108,6 +109,13 @@ class HmcInstance implements Runnable { } while (keepRunning.get()); + // Logout of HMC + try { + hmcRestClient.logoff(); + } catch (IOException e) { + log.warn("run() - error logging out: " + e.getMessage()); + } + } @@ -118,7 +126,6 @@ class HmcInstance implements Runnable { Map tmpPartitions = new HashMap<>(); try { - hmcRestClient.logoff(); hmcRestClient.login(); hmcRestClient.getManagedSystems().forEach((systemId, system) -> { diff --git a/src/main/java/biz/nellemann/hmci/HmcRestClient.java b/src/main/java/biz/nellemann/hmci/HmcRestClient.java index f3a8e1b..1a075c7 100644 --- a/src/main/java/biz/nellemann/hmci/HmcRestClient.java +++ b/src/main/java/biz/nellemann/hmci/HmcRestClient.java @@ -86,6 +86,7 @@ public class HmcRestClient { synchronized void login() throws Exception { log.debug("Connecting to HMC - " + baseUrl); + logoff(); StringBuilder payload = new StringBuilder(); payload.append("");