3 Commits

Author SHA1 Message Date
2356040572 Move catch into then-onRejected to fix resolving then anyways. 2021-11-26 19:07:27 +01:00
b0bbf0c71a Fixed wrong option-subname 2021-11-26 19:06:55 +01:00
37b78e7373 Fixed wrong logging-mode used 2021-11-26 18:54:09 +01:00
2 changed files with 7 additions and 7 deletions

View File

@@ -40,12 +40,7 @@ function checkWriteApi(influxDb, options){
const writeApi = influxDb.getWriteApi(options.org, options.bucket); // Get WriteAPI
writeApi.writePoint(new Point("test").tag("ConnectionTest", true).intField("value", 0).timestamp(0)) // Write dummy-point
writeApi.close()
.catch((err) => {
logger.error("Could not get writeApi:");
logger.error(`Error [${err.code}]:`, err.message);
if(err.code == "not found") logger.fatal("No write-permission?");
reject();
}).then((res) => {
.then((res) => {
logger.debug("Writing ok");
// Delete the connection-text-point
@@ -64,6 +59,11 @@ function checkWriteApi(influxDb, options){
reject();
})
.then(resolve())
},
(err) => {
logger.error("Could not get writeApi:");
logger.error(`Error [${err.code}]:`, err.message);
reject();
});
});
}

View File

@@ -33,7 +33,7 @@ if(errorMsg){
})})
.then((res) => {return InfluxChecks.checkWriteApi(influxDb, {
org: env.INFLUX_ORG,
name: env.INFLUX_BUCKET
bucket: env.INFLUX_BUCKET
})})
.catch((err) => {
if(err) {