Compare commits
No commits in common. "2356040572922cfbaa7384a43eb2b7a2ae17f809" and "c5e1bb4c640a1bb5487e23c62f5ac5b5773b9958" have entirely different histories.
2356040572
...
c5e1bb4c64
@ -40,7 +40,12 @@ function checkWriteApi(influxDb, options){
|
|||||||
const writeApi = influxDb.getWriteApi(options.org, options.bucket); // Get WriteAPI
|
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.writePoint(new Point("test").tag("ConnectionTest", true).intField("value", 0).timestamp(0)) // Write dummy-point
|
||||||
writeApi.close()
|
writeApi.close()
|
||||||
.then((res) => {
|
.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) => {
|
||||||
logger.debug("Writing ok");
|
logger.debug("Writing ok");
|
||||||
|
|
||||||
// Delete the connection-text-point
|
// Delete the connection-text-point
|
||||||
@ -59,11 +64,6 @@ function checkWriteApi(influxDb, options){
|
|||||||
reject();
|
reject();
|
||||||
})
|
})
|
||||||
.then(resolve())
|
.then(resolve())
|
||||||
},
|
|
||||||
(err) => {
|
|
||||||
logger.error("Could not get writeApi:");
|
|
||||||
logger.error(`Error [${err.code}]:`, err.message);
|
|
||||||
reject();
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ if(errorMsg){
|
|||||||
})})
|
})})
|
||||||
.then((res) => {return InfluxChecks.checkWriteApi(influxDb, {
|
.then((res) => {return InfluxChecks.checkWriteApi(influxDb, {
|
||||||
org: env.INFLUX_ORG,
|
org: env.INFLUX_ORG,
|
||||||
bucket: env.INFLUX_BUCKET
|
name: env.INFLUX_BUCKET
|
||||||
})})
|
})})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
if(err) {
|
if(err) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user