dlflannery commited on
Commit
b37b470
·
verified ·
1 Parent(s): 793c31d

Update geo_distance.py

Browse files

error detection not 200 instead of 429

Files changed (1) hide show
  1. geo_distance.py +1 -1
geo_distance.py CHANGED
@@ -13,7 +13,7 @@ def get_geo_coords(address, access_token):
13
  # headers= {"key: " + f"{access_token}", "Content-Type: application/json",}
14
  url = f"{base_url}?key={access_token}&q={quote(address)}&format=json"
15
  response = requests.get(url)
16
- if response.status_code == 429:
17
  sleep(sleep_time)
18
  sleep_time *= 3
19
  else:
 
13
  # headers= {"key: " + f"{access_token}", "Content-Type: application/json",}
14
  url = f"{base_url}?key={access_token}&q={quote(address)}&format=json"
15
  response = requests.get(url)
16
+ if response.status_code != 200: # == 429:
17
  sleep(sleep_time)
18
  sleep_time *= 3
19
  else: