|
|
@ -8,9 +8,9 @@ function checkHealth(influxDb){
|
|
|
|
new Influx.HealthAPI(influxDb) // Check influx health
|
|
|
|
new Influx.HealthAPI(influxDb) // Check influx health
|
|
|
|
.getHealth()
|
|
|
|
.getHealth()
|
|
|
|
.catch((err) => {
|
|
|
|
.catch((err) => {
|
|
|
|
logger.fatal("Could not communicate with Influx:");
|
|
|
|
logger.error("Could not communicate with Influx:");
|
|
|
|
logger.fatal(`Error [${err.code}]:`, err.message);
|
|
|
|
logger.error(`Error [${err.code}]:`, err.message);
|
|
|
|
reject(err);
|
|
|
|
reject();
|
|
|
|
})
|
|
|
|
})
|
|
|
|
.then((res) => {
|
|
|
|
.then((res) => {
|
|
|
|
logger.debug("Server healthy.", "Version: ", res.version);
|
|
|
|
logger.debug("Server healthy.", "Version: ", res.version);
|
|
|
@ -23,9 +23,9 @@ function checkBucket(influxDb, options){
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
new Influx.BucketsAPI(influxDb).getBuckets(options)
|
|
|
|
new Influx.BucketsAPI(influxDb).getBuckets(options)
|
|
|
|
.catch((err) => { // Weirdly the influx-Api returns 404 for searches of non-existing buckets
|
|
|
|
.catch((err) => { // Weirdly the influx-Api returns 404 for searches of non-existing buckets
|
|
|
|
logger.fatal("Could not get bucket:");
|
|
|
|
logger.error("Could not get bucket:");
|
|
|
|
logger.fatal(`Error [${err.code}]:`, err.message);
|
|
|
|
logger.error(`Error [${err.code}]:`, err.message);
|
|
|
|
reject(err);
|
|
|
|
reject();
|
|
|
|
}).then((res) => { // But an empty list when the bucket exists, but token does not have permission to get details
|
|
|
|
}).then((res) => { // But an empty list when the bucket exists, but token does not have permission to get details
|
|
|
|
logger.debug("Bucket found");
|
|
|
|
logger.debug("Bucket found");
|
|
|
|
resolve(res);
|
|
|
|
resolve(res);
|
|
|
|