Add try-catch to influx.writeBatch method.
Test different docker image when building.
This commit is contained in:
parent
b6b45e7144
commit
1b4346b1a5
|
@ -1,4 +1,5 @@
|
||||||
image: openjdk:8
|
image: adoptopenjdk:8-openj9
|
||||||
|
#image: openjdk:8
|
||||||
|
|
||||||
pipelines:
|
pipelines:
|
||||||
branches:
|
branches:
|
||||||
|
@ -16,6 +17,7 @@ pipelines:
|
||||||
- gradle
|
- gradle
|
||||||
name: Build and Release
|
name: Build and Release
|
||||||
script:
|
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/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
|
- 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
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
group = biz.nellemann.hmci
|
group = biz.nellemann.hmci
|
||||||
version = 1.0.2
|
version = 1.0.3
|
||||||
|
|
|
@ -63,7 +63,6 @@ class App implements Runnable {
|
||||||
hmcClient.logoff()
|
hmcClient.logoff()
|
||||||
hmcClient.login()
|
hmcClient.login()
|
||||||
|
|
||||||
log.info("Logging in to HMC " + hmcId)
|
|
||||||
try {
|
try {
|
||||||
hmcClient.getManagedSystems().each { systemId, system ->
|
hmcClient.getManagedSystems().each { systemId, system ->
|
||||||
|
|
||||||
|
|
|
@ -112,9 +112,8 @@ class HmcClient {
|
||||||
Response response = client.newCall(request).execute();
|
Response response = client.newCall(request).execute();
|
||||||
if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
|
if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
|
||||||
|
|
||||||
this.authToken = null
|
authToken = null
|
||||||
log.debug("logoff()")
|
log.debug("logoff()")
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,7 @@ class InfluxClient {
|
||||||
|
|
||||||
void logoff() {
|
void logoff() {
|
||||||
influxDB?.close();
|
influxDB?.close();
|
||||||
|
influxDB = null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -73,7 +74,13 @@ class InfluxClient {
|
||||||
|
|
||||||
void writeBatchPoints() {
|
void writeBatchPoints() {
|
||||||
log.debug("writeBatchPoints()")
|
log.debug("writeBatchPoints()")
|
||||||
influxDB.write(batchPoints);
|
try {
|
||||||
|
influxDB.write(batchPoints);
|
||||||
|
} catch(Exception e) {
|
||||||
|
log.error("writeBatchPoints() error", e)
|
||||||
|
logoff()
|
||||||
|
login()
|
||||||
|
}
|
||||||
//influxDB.flush()
|
//influxDB.flush()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue