vicanso / influxdb-nodejs

Simple influxdb client
https://vicanso.github.io/influxdb-nodejs/
MIT License
88 stars 22 forks source link

epoch not passed to Influx.query #18

Closed sebastienfouss closed 7 years ago

sebastienfouss commented 7 years ago

It seems that the "epoch" value is not passed to the Influx.query.

More precisely, in influx.js, function query accepts 3 parameters: query(q, db, epoch). However, when called by function syncQuery in client.js, only the first parameter is passed, therefore the epoch is undefined and ignore when influxDB is queried.

One way to solve this is to modify the following line in client.js, line 752: return influx.query(arr.join(';')).then((data) => {

shall become return influx.query(arr.join(';'), null, internal(this).options.epoch).then((data) => {

However, I'm not sure that this is the right approach.

vicanso commented 7 years ago

@sebastienfouss I think your approach is workable. You can pull a request to fix it and remember to add test case.