Changed constructor to take influxDb

f_influx-checks
Ruakij 3 years ago
parent d7a9530b68
commit 2a662e0bd1

@ -8,14 +8,12 @@ const {InfluxDB, Point, HttpError} = require('@influxdata/influxdb-client')
class InfluxPointWriter extends Writable{
/**
*
* @param {string} url Influx-Url
* @param {string} token Auth-token
* @param {InfluxDB} influxDb InfluxDb
* @param {string} org Organization to use
* @param {string} bucket Bucket to use
* @param {string} precision Precision to use
* @param {Partial<WriteOptions>} options Options for WriteApi
*/
constructor(url, token, org, bucket, precision = 'us'){
this._api = new InfluxDB({url, token}).getWriteApi(org, bucket, precision);
this._api = influxDb.getWriteApi(org, bucket, 'us', options);
}
_write(point, encoding, next){

Loading…
Cancel
Save