Skip to content

Commit 6b92a1a

Browse files
authored
Merge pull request #590 from bruceadams/timeout
fix: Default timeout for requests.request()
2 parents b4754c9 + 90d5307 commit 6b92a1a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

watson_developer_cloud/watson_service.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,9 @@ def request(self, method, url, accept_json=False, headers=None,
446446
else:
447447
params['api_key'] = self.api_key
448448

449+
# Use a one minute timeout when our caller doesn't give a timeout.
450+
# http://docs.python-requests.org/en/master/user/quickstart/#timeouts
451+
kwargs = dict({"timeout": 60}, **kwargs)
449452
kwargs = dict(kwargs, **self.http_config)
450453

451454
if self.verify is not None:

0 commit comments

Comments
 (0)