Spaces:
Running
Running
Update geo_distance.py
Browse fileserror detection not 200 instead of 429
- 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:
|