From 6fc49d16d7fc9c9b5c80bed4b095d2701fb01d90 Mon Sep 17 00:00:00 2001 From: Giuseppe Bilotta Date: Thu, 30 Aug 2007 22:49:05 +0000 Subject: rss plugin: don't care if reschedule fails A feed watcher may fail to reschedule, for example if it was stopped before completion. Fail graciously warning the user. --- data/rbot/plugins/rss.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'data/rbot') diff --git a/data/rbot/plugins/rss.rb b/data/rbot/plugins/rss.rb index ce52420a..41614609 100644 --- a/data/rbot/plugins/rss.rb +++ b/data/rbot/plugins/rss.rb @@ -764,13 +764,13 @@ class RSSFeedsPlugin < Plugin timer = nil seconds = @bot.config['rss.thread_sleep'] feed.mutex.synchronize do - timer = @watch[feed.handle] + timer = @watch[feed.handle] 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) + @bot.timer.reschedule(timer, seconds) rescue warning "watcher for #{feed} failed to reschedule: #{$!.inspect}" } debug "watcher for #{feed} added" end -- cgit v1.2.3