From 3e63d1b35be72f828f66fc021e10b754628bb802 Mon Sep 17 00:00:00 2001 From: Taylor Hodge Date: Mon, 16 Oct 2023 19:25:42 -0700 Subject: [PATCH] wip: debug --- build_db.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/build_db.py b/build_db.py index 086faec..15d3884 100644 --- a/build_db.py +++ b/build_db.py @@ -70,16 +70,13 @@ def build_database(repo_path): retries = 0 response = None - while retries < 10: + while retries < 3: headers = {} if os.environ.get("GITHUB_TOKEN"): headers = { "authorization": "Bearer {}".format(os.environ["GITHUB_TOKEN"]) } - print("!" * 80) - print(headers) - response = httpx.post( "https://api.github.com/markdown", json={ @@ -91,15 +88,14 @@ def build_database(repo_path): if response.status_code == 200: record["html"] = response.text - time.sleep(10) print("Rendered HTML for {}".format(path)) break elif response.status_code == 401: assert False, "401 Unauthorized returned from GitHub API when rendering markdown" else: print(response.status_code, response.headers) - print(" sleeping 90s") - time.sleep(90) + print(" sleeping 60s") + time.sleep(60) retries += 1 else: assert False, "Could not render {} - last response was {}".format(