Add try-catch to influx.writeBatch method.

Test different docker image when building.
This commit is contained in:
Mark Nellemann 2020-08-16 16:42:05 +02:00
parent b6b45e7144
commit 1b4346b1a5
5 changed files with 14 additions and 7 deletions

View file

@ -1,4 +1,5 @@
image: openjdk:8
image: adoptopenjdk:8-openj9
#image: openjdk:8
pipelines:
branches:
@ -16,6 +17,7 @@ pipelines:
- gradle
name: Build and Release
script:
- ./gradlew clean build shadowJar startShadowScripts buildRpm
- ./gradlew clean build shadowJar startShadowScripts buildRpm buildDeb
- ls -l ${BITBUCKET_CLONE_DIR}/build/distributions/
- for file in ${BITBUCKET_CLONE_DIR}/build/libs/*-all.jar ; do curl -X POST --user "${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"${file}" ; done
- for file in ${BITBUCKET_CLONE_DIR}/build/distributions/*.rpm ; do curl -X POST --user "${BB_AUTH_STRING}" "https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/downloads" --form files=@"${file}" ; done

View file

@ -1,2 +1,2 @@
group = biz.nellemann.hmci
version = 1.0.2
version = 1.0.3

View file

@ -63,7 +63,6 @@ class App implements Runnable {
hmcClient.logoff()
hmcClient.login()
log.info("Logging in to HMC " + hmcId)
try {
hmcClient.getManagedSystems().each { systemId, system ->

View file

@ -112,9 +112,8 @@ class HmcClient {
Response response = client.newCall(request).execute();
if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
this.authToken = null
authToken = null
log.debug("logoff()")
}

View file

@ -52,6 +52,7 @@ class InfluxClient {
void logoff() {
influxDB?.close();
influxDB = null
}
@ -73,7 +74,13 @@ class InfluxClient {
void writeBatchPoints() {
log.debug("writeBatchPoints()")
influxDB.write(batchPoints);
try {
influxDB.write(batchPoints);
} catch(Exception e) {
log.error("writeBatchPoints() error", e)
logoff()
login()
}
//influxDB.flush()
}