Commit 1d8417d3 authored by decapstrike's avatar decapstrike Committed by Francesco Poldi

Add timeout to geocoder (#336)

* Add timeout to geocoder

Was experiencing frequent 429 errors that indicated too many requests to the service. Added a timeout to avoid this issue.

* Updated for previous patch
parent 31c6957a
...@@ -20,7 +20,7 @@ class RecycleObject(object): ...@@ -20,7 +20,7 @@ class RecycleObject(object):
def flush(self): pass def flush(self): pass
def getLocation(place, **options): def getLocation(place, **options):
location = geolocator.geocode(place) location = geolocator.geocode(place,timeout=1000)
if location: if location:
if options.get("near"): if options.get("near"):
global _near global _near
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment