-
Notifications
You must be signed in to change notification settings - Fork 121
Adding request timeout #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 9 commits
7dd6a4a
1d915e2
98f9ce8
83b5047
b73f4ad
545ade3
8365a37
456ed7f
1acce6a
25ac7f2
561e59a
1be8337
fd18039
eba1de2
7214851
6c762cb
ef1621d
9000528
1115d03
1280a99
c90d401
c7d57b9
0f88e26
0fcd77b
d3c35da
73b4341
81ea5bd
fd4692b
93f573c
206e2a0
5464f7a
1e465f8
7f70e5c
021e7dd
18d1824
0712ced
7523266
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -582,6 +582,8 @@ def _send(self, method, path, content=None, query_params={}, headers={}, | |
|
|
||
| if headers["Content-Type"] == "application/json" and content is not None: | ||
| content = json.dumps(content) | ||
|
|
||
| request_timeout = 10.0 + query_params.get("timeout", 30000) / 1000 | ||
|
|
||
| response = None | ||
| while True: | ||
|
|
@@ -590,7 +592,8 @@ def _send(self, method, path, content=None, query_params={}, headers={}, | |
| params=query_params, | ||
| data=content, | ||
| headers=headers, | ||
| verify=self.validate_cert | ||
| verify=self.validate_cert, | ||
| timeout=request_timeout | ||
|
||
| ) | ||
|
|
||
| if response.status_code == 429: | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any particular reason we're forcing this to be a float instead of an int?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no. It is just because the requests_timeout could be a float. I will change it.