From 37f9fdca2fe1305febe801d169071e35d2ac3e91 Mon Sep 17 00:00:00 2001 From: dmitry kim Date: Tue, 27 Jan 2009 16:27:10 +0300 Subject: * (rss.rb) bypass the http cache on !rss rewatch --- data/rbot/plugins/rss.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'data/rbot/plugins/rss.rb') diff --git a/data/rbot/plugins/rss.rb b/data/rbot/plugins/rss.rb index f80236f0..6d8d3c26 100644 --- a/data/rbot/plugins/rss.rb +++ b/data/rbot/plugins/rss.rb @@ -185,7 +185,7 @@ end class ::RssBlob attr_accessor :url, :handle, :type, :refresh_rate, :xml, :title, :items, - :mutex, :watchers, :last_fetched + :mutex, :watchers, :last_fetched, :http_cache def initialize(url,handle=nil,type=nil,watchers=[], xml=nil, lf = nil) @url = url @@ -197,6 +197,7 @@ class ::RssBlob @type = type @watchers=[] @refresh_rate = nil + @http_cache = false @xml = xml @title = nil @items = nil @@ -836,6 +837,7 @@ class RSSFeedsPlugin < Plugin if params and handle = params[:handle] feed = @feeds.fetch(handle.downcase, nil) if feed + feed.http_cache = false @bot.timer.reschedule(@watch[feed.handle], (params[:delay] || 0).to_f) m.okay if m else @@ -873,9 +875,10 @@ class RSSFeedsPlugin < Plugin debug "fetching #{feed}" first_run = !feed.last_fetched oldxml = feed.xml ? feed.xml.dup : nil - unless fetchRss(feed) + unless fetchRss(feed, nil, feed.http_cache) failures += 1 else + feed.http_cache = true if first_run debug "first run for #{feed}, getting items" parseRss(feed) -- cgit v1.2.3