diff options
author | jcass <john.cass77@gmail.com> | 2016-01-24 06:52:01 +0200 |
---|---|---|
committer | jcass <john.cass77@gmail.com> | 2016-01-24 06:52:01 +0200 |
commit | 9c298b18519a3cf41c7c1566c52f68b55324c010 (patch) | |
tree | c2377e9cca89f1df73dc6970c07b7f024ecb2c67 | |
parent | 473872dc0e3ffbcad5dfe4fec69e41755c47c549 (diff) | |
download | pydora-9c298b18519a3cf41c7c1566c52f68b55324c010.tar.bz2 pydora-9c298b18519a3cf41c7c1566c52f68b55324c010.tar.xz pydora-9c298b18519a3cf41c7c1566c52f68b55324c010.zip |
Set retries for HTTP adapter and SysCallErrors to three.
-rw-r--r-- | pandora/transport.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pandora/transport.py b/pandora/transport.py index cdd1699..58d4097 100644 --- a/pandora/transport.py +++ b/pandora/transport.py | |||
@@ -86,14 +86,14 @@ class RetryingSession(requests.Session): | |||
86 | """Requests Session With Retry Support | 86 | """Requests Session With Retry Support |
87 | 87 | ||
88 | This Requests session uses an HTTPAdapter that retries on connection | 88 | This Requests session uses an HTTPAdapter that retries on connection |
89 | failure at least once. The Pandora API is fairly aggressive about closing | 89 | failure three times. The Pandora API is fairly aggressive about closing |
90 | connections on clients and the default session doesn't retry. | 90 | connections on clients and the default session doesn't retry. |
91 | """ | 91 | """ |
92 | 92 | ||
93 | def __init__(self): | 93 | def __init__(self): |
94 | super(RetryingSession, self).__init__() | 94 | super(RetryingSession, self).__init__() |
95 | self.mount('https://', HTTPAdapter(max_retries=1)) | 95 | self.mount('https://', HTTPAdapter(max_retries=3)) |
96 | self.mount('http://', HTTPAdapter(max_retries=1)) | 96 | self.mount('http://', HTTPAdapter(max_retries=3)) |
97 | 97 | ||
98 | 98 | ||
99 | class APITransport(object): | 99 | class APITransport(object): |
@@ -224,7 +224,7 @@ class APITransport(object): | |||
224 | # TODO: This decorator is a temporary workaround for handling | 224 | # TODO: This decorator is a temporary workaround for handling |
225 | # SysCallErrors, see: https://github.com/shazow/urllib3/issues/367. | 225 | # SysCallErrors, see: https://github.com/shazow/urllib3/issues/367. |
226 | # Should be removed once a fix is applied in urllib3. | 226 | # Should be removed once a fix is applied in urllib3. |
227 | @retries(5) | 227 | @retries(3) |
228 | def __call__(self, method, **data): | 228 | def __call__(self, method, **data): |
229 | self._start_request(method) | 229 | self._start_request(method) |
230 | 230 | ||