This repository was archived by the owner on Oct 29, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
16
16
- Add mypy testing framework (#756 )
17
17
- Add support for messagepack (#734 thx @lovasoa )
18
18
- Add support for 'show series' (#357 thx @gaker )
19
+ - Add support for custom request session in InfluxDBClient (#360 thx @dschien )
19
20
20
21
### Changed
21
22
- Clean up stale CI config (#755 )
Original file line number Diff line number Diff line change @@ -70,6 +70,9 @@ class InfluxDBClient(object):
70
70
as a single file containing the private key and the certificate, or as
71
71
a tuple of both files’ paths, defaults to None
72
72
:type cert: str
73
+ :param session: allow for the new client request to use an existing
74
+ requests Session, defaults to None
75
+ :type session: requests.Session
73
76
74
77
:raises ValueError: if cert is provided but ssl is disabled (set to False)
75
78
"""
@@ -90,6 +93,7 @@ def __init__(self,
90
93
pool_size = 10 ,
91
94
path = '' ,
92
95
cert = None ,
96
+ session = None ,
93
97
):
94
98
"""Construct a new InfluxDBClient object."""
95
99
self .__host = host
@@ -104,7 +108,11 @@ def __init__(self,
104
108
105
109
self .__use_udp = use_udp
106
110
self .__udp_port = udp_port
107
- self ._session = requests .Session ()
111
+
112
+ if not session :
113
+ session = requests .Session ()
114
+
115
+ self ._session = session
108
116
adapter = requests .adapters .HTTPAdapter (
109
117
pool_connections = int (pool_size ),
110
118
pool_maxsize = int (pool_size )
You can’t perform that action at this time.
0 commit comments