summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/rbot/plugins/rss.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/data/rbot/plugins/rss.rb b/data/rbot/plugins/rss.rb
index 62ce48d9..6451996d 100644
--- a/data/rbot/plugins/rss.rb
+++ b/data/rbot/plugins/rss.rb
@@ -761,12 +761,14 @@ class RSSFeedsPlugin < Plugin
status[:failures] = failures
+ timer = nil
feed.mutex.synchronize do
+ timer = @watch[feed.handle]
seconds = (feed.refresh_rate || @bot.config['rss.thread_sleep']) * (failures + 1)
- seconds += seconds * (rand(100)-50)/100
- debug "watcher for #{feed} going to sleep #{seconds} seconds.."
- @bot.timer.reschedule(@watch[feed.handle], seconds)
end
+ seconds += seconds * (rand(100)-50)/100
+ debug "watcher for #{feed} going to sleep #{seconds} seconds.."
+ @bot.timer.reschedule(timer, seconds)
}
debug "watcher for #{feed} added"
end