Skip to content

Commit 2b35b76

Browse files
committed
Make timeout configurable upon Construction
1 parent 311e608 commit 2b35b76

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

reportportal_client/service.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ def __init__(self,
167167
verify_ssl=True,
168168
retries=None,
169169
max_pool_size=50,
170+
post_timeout=(10, 10),
170171
**kwargs):
171172
"""Init the service class.
172173
@@ -181,6 +182,9 @@ def __init__(self,
181182
verify_ssl: option to not verify ssl certificates
182183
max_pool_size: option to set the maximum number of
183184
connections to save in the pool.
185+
post_timeout: a float in seconds for the connect and read
186+
timeout. Use a Tuple to specific connect and
187+
read separately.
184188
"""
185189
self._batch_logs = []
186190
self.endpoint = endpoint
@@ -190,7 +194,7 @@ def __init__(self,
190194
self.is_skipped_an_issue = is_skipped_an_issue
191195
self.base_url_v1 = uri_join(self.endpoint, "api/v1", self.project)
192196
self.base_url_v2 = uri_join(self.endpoint, "api/v2", self.project)
193-
self.post_timeout = (10, 10)
197+
self.post_timeout = post_timeout
194198

195199
self.session = requests.Session()
196200
if retries:

0 commit comments

Comments
 (0)