mirror of
https://github.com/ddworken/hishtory.git
synced 2025-04-11 19:18:25 +02:00
Longer timeout + better error message
This commit is contained in:
parent
62d67a37ca
commit
a9d1dcfb40
@ -43,8 +43,8 @@ def waitUntilPublished(url, output) -> None:
|
|||||||
r = requests.get(url, headers={'authorization': f'bearer {os.environ["GITHUB_TOKEN"]}'})
|
r = requests.get(url, headers={'authorization': f'bearer {os.environ["GITHUB_TOKEN"]}'})
|
||||||
if r.status_code == 200:
|
if r.status_code == 200:
|
||||||
break
|
break
|
||||||
if (time.time() - startTime)/60 > 10:
|
if (time.time() - startTime)/60 > 20:
|
||||||
raise Exception("failed to get url, status_code=" + str(r.status_code) + " body=" + str(r.content))
|
raise Exception("failed to get url={url} (startTime={startTime}, endTime={time.time()}), status_code=" + str(r.status_code) + " body=" + str(r.content))
|
||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
with open(output, 'wb') as f:
|
with open(output, 'wb') as f:
|
||||||
f.write(r.content)
|
f.write(r.content)
|
||||||
|
Loading…
Reference in New Issue
Block a user