For a long while now, my demo transit application hasn't been picking up new articles from the web - leaving the home page looking quite stale between deployments.
Earlier this week I added extra logging to capture counts of different kinds of articles, and noticed this morning that new articles were only found the first time the parsers run. After reviewing the simple logic for determining which articles are new, I noticed the cache implementation problem.
I had implemented a crude cache using a hash map, but apparently forgot to write the cache expiration logic. When the parsers went to look at news listing pages, the cache was returning a stale block of content rather than fetching the new content from the internet. I was so sure I wrote that expiration logic! So things are all fixed up and I'm going to be verifying the fix over the next few days.
Nothing quite beats the feeling of finding a simple explanation for a pesky bug.
Comments
Post a Comment