zebpalmer / WeatherAlerts

Python script to parse the National Weather Service 'Cap' Alerts Feed and do interesting things with it.
MIT License
31 stars 14 forks source link

SameCodes assumes the cache is always correct #9

Open Resisty opened 7 years ago

Resisty commented 7 years ago

In geo.py, SameCodes._cached_same_codes() returns True regardless of the contents of the cache file. After a failed run, the cache file existed on my file system but was empty. Subsequent attempts all failed because no SAME codes were available.

In addition to checking if the file exists, please ensure that the cache also has useful information and if not, reload().

Thanks!

zebpalmer commented 7 years ago

Thanks for the report. This is ancient code, surprised it still works at all. I am planning on giving it some TLC early next month. Revamping the cache logic is on the list.