Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't abort query #605

Open
frederikheld opened this issue Dec 3, 2021 · 0 comments
Open

Can't abort query #605

frederikheld opened this issue Dec 3, 2021 · 0 comments

Comments

@frederikheld
Copy link

frederikheld commented Dec 3, 2021

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

  1. use a wrong server address
  2. 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: ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant