Skip to content

Commit

Permalink
Fixed cache validation...
Browse files Browse the repository at this point in the history
  • Loading branch information
th3w4y committed Sep 3, 2016
1 parent 29fa762 commit 8f7f22c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pokemongo_bot/walkers/polyline_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def cached_polyline(origin, destination, speed, google_map_api_key=None):
abs_offset = haversine.haversine(tuple(origin), PolylineObjectHandler._cache.get_last_pos())*1000
else:
abs_offset = float("inf")
is_old_cache = lambda : abs_offset < 8 # Consider cache old if we identified an offset more then 8 m
is_old_cache = lambda : abs_offset > 8 # Consider cache old if we identified an offset more then 8 m
new_dest_set = lambda : tuple(destination) != PolylineObjectHandler._cache.destination

if PolylineObjectHandler._run and (not is_old_cache()):
Expand Down

0 comments on commit 8f7f22c

Please sign in to comment.