diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-08-28 10:58:59 +0000 |
---|---|---|
committer | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2007-08-28 10:58:59 +0000 |
commit | 202b7d11fbae57ec1deddc0397019626ba9ab464 (patch) | |
tree | ce152102bdc9006a2bdb5bc58435996e52d3f471 /data | |
parent | 088cea5b9473cbf5796aac0e6104442138a11f07 (diff) |
rss plugin: fix watcher rescheduling broken in previous commit
Diffstat (limited to 'data')
-rw-r--r-- | data/rbot/plugins/rss.rb | 4 |
1 files changed, 3 insertions, 1 deletions
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)
|