node-influx
node-influx copied to clipboard
Can't abort query
Expected Behavior
There should be a way to abort a running query, either by passing an integer in milliseconds as timeout or an AbortController (like it can be done with fetch) into the query function.
Example with fetch:
const abortController = new AbortController()
const abortTimeout = setTimeout(() => {
abortController.abort()
}, 10000)
await fetch('<url>', {
options: { /* options */ },
signal: abortController.signal
})
clearTimeout(abortTimeout)
Actual Behavior
If the server isn't available or the network is bad, the query just takes forever.
Steps/Code to Reproduce the Problem
- use a wrong server address
- then start a query
const Influx = require('influx')
const influx = new Influx.InfluxDB(/* connection data with wrong address */)
const result = await influx.query(/* query */)
console.log('this line will never be executed')
Specifications
- Version: 5.6.0
- Platform: ?
- Subsystem: ?