Fix behavior that getUrl() does not retry

getUrl() now use `requests.get()` that is default getter that does not retry.
This change corrects it to `session.get()`

Related issue #472

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
This commit is contained in:
Hiroshi Miura
2022-01-11 15:22:29 +09:00
parent 1d0be589be
commit 87f95ddc59

View File

@@ -57,7 +57,7 @@ def getUrl(url: str, timeout) -> str:
session.mount("http://", adapter)
session.mount("https://", adapter)
try:
r = requests.get(url, allow_redirects=False, timeout=timeout)
r = session.get(url, allow_redirects=False, timeout=timeout)
num_redirects = 0
while 300 < r.status_code < 309 and num_redirects < 10:
num_redirects += 1