<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -23,11 +23,17 @@ class WelcomeController &lt; ApplicationController
       CACHE.set(&quot;welcome_feeds&quot;, @feeds, 60*60)
     end
     
+    delay = 30
+    
     # Get english rss from cache or from net
     unless @rss_english = CACHE.get(&quot;rss_english&quot;)
       begin
-        @rss_english = show_post Hpricot(open('http://blog.feevy.com/feed/')).search(&quot;item&quot;).first
-        CACHE.set(&quot;rss_english&quot;, @rss_english, 60*60)
+        Timeout::timeout(delay) {
+          @rss_english = show_post Hpricot(open('http://blog.feevy.com/feed/')).search(&quot;item&quot;).first
+        }
+      rescue Timeout::Error
+        logger.debug &quot;Timeout while reading english blog feed: #{err}&quot;
+        @rss_english = []
       rescue =&gt; err
         logger.debug &quot;Error while reading english blog feed: #{err}&quot;
         @rss_english = []
@@ -37,14 +43,21 @@ class WelcomeController &lt; ApplicationController
     # Get spanish rss from cache or from net
     unless @rss_spanish = CACHE.get(&quot;rss_spanish&quot;)
       begin
-        @rss_spanish = show_post Hpricot(open('http://bitacora.feevy.com/feed/')).search(&quot;item&quot;).first
-        CACHE.set(&quot;rss_spanish&quot;, @rss_spanish, 60*60)
+        Timeout::timeout(delay) {
+          @rss_spanish = show_post Hpricot(open('http://bitacora.feevy.com/feed/')).search(&quot;item&quot;).first
+        }
+      rescue Timeout::Error
+        logger.debug &quot;Timeout while reading spanish blog feed: #{err}&quot;
+        @rss_spanish = []
       rescue =&gt; err
         logger.debug &quot;Error while reading spanish blog feed: #{err}&quot;
         @rss_spanish = []
       end
     end
     
+    CACHE.set(&quot;rss_spanish&quot;, @rss_spanish, 60*60)
+    CACHE.set(&quot;rss_english&quot;, @rss_english, 60*60)
+    
     unless @nb_users = CACHE.get(&quot;nb_users&quot;)
       @nb_users = User.count
       CACHE.set(&quot;nb_users&quot;, @nb_users, 60*60)</diff>
      <filename>app/controllers/welcome_controller.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>d4088ff19c5c6d9ae0b3e52049da0fdf0f5aac8d</id>
    </parent>
  </parents>
  <author>
    <name>Alexandre Girard</name>
    <email>alx.girard@gmail.com</email>
  </author>
  <url>http://github.com/alx/feevy/commit/b3189c41e548f36d1ae4d3c2b0c8266d9433fc27</url>
  <id>b3189c41e548f36d1ae4d3c2b0c8266d9433fc27</id>
  <committed-date>2008-11-24T09:41:33-08:00</committed-date>
  <authored-date>2008-11-24T09:41:33-08:00</authored-date>
  <message>Add timeout when reading feeds from homepage</message>
  <tree>696737d930ae258c5452680fa0b1955a8756413b</tree>
  <committer>
    <name>Alexandre Girard</name>
    <email>alx.girard@gmail.com</email>
  </committer>
</commit>
