Closed Snowius closed 2 months ago
Update:
I've been running my two instances for a week now with the fixed code and it seems much better on the costs. As you can see here, I've created my instances a week ago on the 18th and they have been running since then (shows 6 but will be 7 in 3 hours when it hits 1 PM).
With this, here's my metrics for the Google Geocoding API
As you can see, since the 18th of April, the API stopped being used as much. In fact, once it already knows the information for all of my favorite locations, it will not send any more requests because all the locations will be cached in the program.
If you consider using this fix, it would surely benefit some people :)
Hey, I'm using the calculate distance time feature with Google Maps and I'm noticing that my costs keeps going up daily even with the "caching" in place and the fact that my instances have been running for a few days so all the bags I have have already been cached supposedly. In fact, my geocoding API keeps being pinged for every single bag (whilst the direction API stalled and is not being called anymore since all is cached). Why is it done like this? I looked into the code and it's basically because we always check if the adress is valid before going into the cached places. Is it not an easy fix though?
location.py:
I wonder if we can just take this code
and put it in front of this condition?
This way, we always check the dictionary before spamming the geocoding API with "is this adress valid?" every single time we try to get a notification about a new bag.
I'll probably make my own container with the fixed code but I figured it could be useful to change it in the main project as well.
Thoughts?