From: Jeremy Stanley Date: Sun, 31 May 2020 00:24:10 +0000 (+0000) Subject: Use a dedicated field for cached search timestamps X-Git-Tag: 2.4~5 X-Git-Url: https://www.yuggoth.org/gitweb?p=weather.git;a=commitdiff_plain;h=74a9ee62f69ff8f801740348186f321991f81a8f;hp=5515f756d42c1fbb00f506cf30474143061863c6 Use a dedicated field for cached search timestamps Fix a cache corruption issue by using a new "cached" field to hold the timestamp for cached correlation search results. Previously the "description" field was being overloaded, but this could cause the cache to no longer load because of duplicate fields. --- diff --git a/weather.py b/weather.py index fa94727..1dfa081 100644 --- a/weather.py +++ b/weather.py @@ -1134,7 +1134,7 @@ def guess( ) search_cache = ["\n"] search_cache.append( "[%s]\n" % search[0] ) - search_cache.append( "description = cached %s\n" % nowstamp ) + search_cache.append( "cached = %s\n" % nowstamp ) for uriname in sorted(uris.keys()): search_cache.append( "%s = %s\n" % ( uriname, uris[uriname] ) ) real_cachedir = os.path.expanduser(cachedir)