Commit 9b550055ab0164a468c2805a46dda5e119195e19

Authored by Antoine Goutenoir
1 parent e42b2aa7
Exists in master

Clean up.

Showing 1 changed file with 2 additions and 2 deletions   Show diff stats
flaskr/geocoder.py
... ... @@ -10,13 +10,13 @@ class CachedGeocoder:
10 10 def __init__(self, source="Nominatim", geocache="geocache.db"):
11 11 self.geocoder = getattr(geopy.geocoders, source)()
12 12 self.cache = shelve.open(get_path(geocache), writeback=True)
13   - self.timestamp = time.time() + 1.5
  13 + # self.timestamp = time.time() + 1.5
14 14  
15 15 def geocode(self, address):
16 16 if address not in self.cache:
17 17 # time.sleep(max(0, 1 - (time.time() - self.timestamp)))
18 18 time.sleep(1.618)
19   - self.timestamp = time.time()
  19 + # self.timestamp = time.time()
20 20 self.cache[address] = self.geocoder.geocode(
21 21 query=address,
22 22 timeout=5,
... ...