Skip to content

Commit

Permalink
Calculate full_url only once
Browse files Browse the repository at this point in the history
  • Loading branch information
Salamandar committed Nov 4, 2024
1 parent a31421a commit 3140d58
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/curl_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,13 @@ def test(
else:
cookies = None

full_url = base_url + path
code = None
retried = 0
while code is None or code in {502, 503, 504}:
time.sleep(retried * 5)
code, content, effective_url = curl(
base_url + path, post=post, use_cookies=cookies
full_url, post=post, use_cookies=cookies
)
retried += 1
if retried > 3:
Expand Down Expand Up @@ -240,7 +241,7 @@ def test(
assets.append((domain + asset, asset_code))

return {
"url": f"{base_url}{path}",
"url": full_url,
"effective_url": effective_url,
"code": code,
"title": title,
Expand Down

0 comments on commit 3140d58

Please sign in to comment.