diff app/models/tweet.rb @ 86:5bfc986200db

The caching becomes a bit confusing because of parameters
author nanaya <me@myconan.net>
date Mon, 27 Jun 2016 05:14:10 +0900
parents 924b3a4ed3ef
children cf9a9ce2d034
line wrap: on
line diff
--- a/app/models/tweet.rb	Mon Jun 27 05:12:40 2016 +0900
+++ b/app/models/tweet.rb	Mon Jun 27 05:14:10 2016 +0900
@@ -1,11 +1,11 @@
 class Tweet
-  def timeline(options = {})
+  def timeline
     start_client_config_id = @client_config_id
 
     begin
       @timeline ||=
-        Rails.cache.fetch({ :timeline => @twitter_id, :options => options.dup }, :expires_in => 5.minutes) do
-          @client.user_timeline(@twitter_id, options)
+        Rails.cache.fetch({ :timeline => @twitter_id }, :expires_in => 5.minutes) do
+          @client.user_timeline(@twitter_id, :count => 40, :exclude_replies => false, :include_rts => true)
         end
     rescue Twitter::Error::TooManyRequests
       next_client_config_id = @client_config_id + 1