Skip to content

Commit

Permalink
fix try-except in conf_from_url
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandrofelder committed Jan 24, 2025
1 parent 6dc04bc commit dab1c8b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions brainglobe_atlasapi/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,10 @@ def conf_from_url(url) -> configparser.ConfigParser:
if status_code == 200:
break
except requests.exceptions.ConnectionError:
max_tries -= 1
sleep(sleep_time)
sleep_time *= 2
pass # keep trying to connect
max_tries -= 1
sleep(sleep_time)
sleep_time *= 2

if status_code != 200:
print(f"Could not fetch the latest atlas versions: {status_code}")
Expand Down

0 comments on commit dab1c8b

Please sign in to comment.