summaryrefslogtreecommitdiff
path: root/lib/feed2imap/feed2imap.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/feed2imap/feed2imap.rb')
-rw-r--r--lib/feed2imap/feed2imap.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/feed2imap/feed2imap.rb b/lib/feed2imap/feed2imap.rb
index f6c64bc..3627ab0 100644
--- a/lib/feed2imap/feed2imap.rb
+++ b/lib/feed2imap/feed2imap.rb
@@ -19,6 +19,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# Feed2Imap version
F2I_VERSION = '0.9.3'
+F2I_WARNFETCHTIME = 10
require 'feed2imap/config'
require 'feed2imap/cache'
@@ -118,6 +119,7 @@ class Feed2Imap
end
sparefetchers -= 1
end
+ fetch_start = Time::now
if feed.url
s = HTTPFetcher::fetch(feed.url, @cache.get_last_check(feed.name))
elsif feed.execurl
@@ -148,6 +150,9 @@ class Feed2Imap
end
mutex.unlock
end
+ if Time::now - fetch_start > F2I_WARNFETCHTIME
+ @logger.info("Fetching feed #{feed.name} took #{(Time::now - fetch_start).to_i}s")
+ end
sparefetchers_mutex.synchronize do
sparefetchers += 1
sparefetchers_cond.signal