changeset 88:cf9a9ce2d034

Increase cache timeout to ease up load ;_;
author nanaya <me@myconan.net>
date Tue, 28 Jun 2016 02:38:27 +0900
parents b01b5265e6d1
children d5a0d66ee457
files app/models/tweet.rb
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/app/models/tweet.rb	Mon Jun 27 06:01:39 2016 +0900
+++ b/app/models/tweet.rb	Tue Jun 28 02:38:27 2016 +0900
@@ -4,7 +4,7 @@
 
     begin
       @timeline ||=
-        Rails.cache.fetch({ :timeline => @twitter_id }, :expires_in => 5.minutes) do
+        Rails.cache.fetch({ :timeline => @twitter_id }, :expires_in => 20.minutes) do
           @client.user_timeline(@twitter_id, :count => 40, :exclude_replies => false, :include_rts => true)
         end
     rescue Twitter::Error::TooManyRequests
@@ -24,7 +24,7 @@
       if timeline.any?
         timeline.first.user
       else
-        Rails.cache.fetch({ :user => @twitter_id }, :expires_in => 5.minutes) do
+        Rails.cache.fetch({ :user => @twitter_id }, :expires_in => 20.minutes) do
           @client.user(@twitter_id)
         end
       end