-
Notifications
You must be signed in to change notification settings - Fork 187
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
feat: Pass timeout to read and write queries #249
Conversation
Hi @nikoladsp, thanks for your PR. The issue with passing timeout to HTTP requests was resolved in a Milestone 1.17.0 by #222. Or am I missing something? Regards |
Hi, Client is instantiated with: url = "http://localhost:8086"
token = "MyToken"
org = "MyOrg"
timeout = 60000
cli = InfluxDBClient(url=url, token=token, org=org, timeout=timeout) So when in for example influxdb_client/service/write_service.py in code return self.api_client.call_api(
'/api/v2/write', 'POST',
path_params,
query_params,
header_params,
body=body_params,
post_params=form_params,
files=local_var_files,
response_type=None, # noqa: E501
auth_settings=auth_settings,
async_req=local_var_params.get('async_req'),
_return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501
_preload_content=local_var_params.get('_preload_content', True),
_request_timeout=local_var_params.get('_request_timeout'),
collection_formats=collection_formats,
urlopen_kw=urlopen_kw) _request_timeout was set to None, so we used the patch in subject. Maybe we did something wrong? Thanks |
The request timeout is set in lower API. Try to add breakpoint here:
|
If I set timeout in InfluxDBClient constructor, should not be passed to the actual self.api_client.call_api call? Regards |
It is not necessary because it is set in underlaying API:
Which version of client do you use? |
We tried 1.17.0 |
The version |
Does this applies only to connection timeout or also when reading/writing? Thanks |
This combines the connect and read timeouts into one. You can also specify timeout as tuple: |
Many thanks. In that case we must have some strange issue in our code. I will try to investigate one more time. Best regards |
Hi @nikoladsp, did you solve the problem with timeout? Regards |
This PR has been closed because it has not had recent activity. Please reopen if this PR is still important to you and you want to continue with them. |
Closes #
Proposed Changes
Request timeout is passed to read and write calls. Not sure if this is the way you would implement it, but we really needed those so thought to share our current implementation in case you find it useful.
Kindest regards