From 202b7d11fbae57ec1deddc0397019626ba9ab464 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Tue, 28 Aug 2007 10:58:59 +0000 Subject: rss plugin: fix watcher rescheduling broken in previous commit --- data/rbot/plugins/rss.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/rbot/plugins/rss.rb b/data/rbot/plugins/rss.rb index 6451996d..c34e5926 100644 --- a/data/rbot/plugins/rss.rb +++ b/data/rbot/plugins/rss.rb @@ -762,10 +762,12 @@ class RSSFeedsPlugin < Plugin status[:failures] = failures timer = nil + seconds = @bot.config['rss.thread_sleep'] feed.mutex.synchronize do timer = @watch[feed.handle] - seconds = (feed.refresh_rate || @bot.config['rss.thread_sleep']) * (failures + 1) + seconds = feed.refresh_rate if feed.refresh_rate end + seconds *= failures + 1 seconds += seconds * (rand(100)-50)/100 debug "watcher for #{feed} going to sleep #{seconds} seconds.." @bot.timer.reschedule(timer, seconds) -- cgit v1.2.3