Skip to content

Commit e85950a

Browse files
committed
Merge pull request influxdata#35 from salanki/master
Added optional read timeout.
2 parents e259392 + e7ce982 commit e85950a

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)