diff --git a/src/streamHandler/InfluxPointWriter.js b/src/streamHandler/InfluxPointWriter.js index 9a57136..fbf64cc 100644 --- a/src/streamHandler/InfluxPointWriter.js +++ b/src/streamHandler/InfluxPointWriter.js @@ -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} 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){