From 58e7e61d69c085a31e5b3d67a5527a5fa2c194a7 Mon Sep 17 00:00:00 2001 From: Arnout Engelen Date: Fri, 4 May 2012 10:26:09 +0200 Subject: [PATCH] Only reset the cached feed when the response actually contains headlines Some feeds, such as those from sourceforge.net, will sometimes show an error page rather than a feed. In this case the feed cache used to be cleared for that feed, causing all 'old' headlines to be flooded to the channel as soon as the feed came back online. This patch hopefully fixes that by only resetting the cache when the returned page actually contains headlines. Signed-off-by: James McCoy --- plugins/RSS/plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/RSS/plugin.py b/plugins/RSS/plugin.py index e2fd5eeca..bb328663e 100644 --- a/plugins/RSS/plugin.py +++ b/plugins/RSS/plugin.py @@ -236,7 +236,7 @@ class RSS(callbacks.Plugin): # These seem mostly harmless. We'll need reports of a # kind that isn't. self.log.debug('Allowing bozo_exception %r through.', e) - if results.get('feed', {}): + if results.get('feed', {}) and self.getHeadlines(results): self.cachedFeeds[url] = results self.lastRequest[url] = time.time() else: