Skip to content

Commit e7ce982

Browse files
committed
Added optional read timeout, defaults to no timeout.
From requests documentation "timeout is not a time limit on the entire response download; rather, an exception is raised if the server has not issued a response for timeout seconds (more precisely, if no bytes have been received on the underlying socket for timeout seconds)."
1 parent 5767c53 commit e7ce982

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

influxdb/client.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class InfluxDBClient(object):
1414
"""
1515

1616
def __init__(self, host='localhost', port=8086, username='root',
17-
password='root', database=None, ssl=False, verify_ssl=False):
17+
password='root', database=None, ssl=False, verify_ssl=False, timeout=0):
1818
"""
1919
Initialize client
2020
"""
@@ -23,6 +23,7 @@ def __init__(self, host='localhost', port=8086, username='root',
2323
self._username = username
2424
self._password = password
2525
self._database = database
26+
self._timeout = timeout
2627

2728
self._verify_ssl = verify_ssl
2829

@@ -90,7 +91,8 @@ def request(self, url, method='GET', params=None, data=None,
9091
params=params,
9192
data=data,
9293
headers=self._headers,
93-
verify=self._verify_ssl
94+
verify=self._verify_ssl,
95+
timeout=self._timeout
9496
)
9597

9698
if response.status_code == status_code:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy