-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
48 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- /tmp/rest.py 2024-12-17 11:03:15.841466241 +0100 | ||
+++ kubernetes_asyncio/client/rest.py 2024-12-17 11:03:22.851477070 +0100 | ||
@@ -104,8 +104,7 @@ | ||
:param _request_timeout: timeout setting for this request. If one | ||
number provided, it will be total request | ||
timeout. It can also be a pair (tuple) of | ||
- (connection, read) timeouts or object | ||
- of aiohttp.ClientTimeout. | ||
+ (connection, read) timeouts. | ||
""" | ||
method = method.upper() | ||
assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', | ||
@@ -118,18 +117,7 @@ | ||
|
||
post_params = post_params or {} | ||
headers = headers or {} | ||
- timeout = aiohttp.ClientTimeout() | ||
- if _request_timeout: | ||
- if isinstance(_request_timeout, (int, float)): | ||
- timeout = aiohttp.ClientTimeout(total=_request_timeout) | ||
- elif isinstance(_request_timeout, tuple) and len(_request_timeout) == 2: | ||
- timeout = aiohttp.ClientTimeout( | ||
- connect=_request_timeout[0], | ||
- sock_connect=_request_timeout[0], | ||
- sock_read=_request_timeout[1], | ||
- ) | ||
- elif isinstance(_request_timeout, aiohttp.ClientTimeout): | ||
- timeout = _request_timeout | ||
+ timeout = _request_timeout or 5 * 60 | ||
|
||
if 'Content-Type' not in headers: | ||
headers['Content-Type'] = 'application/json' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters