From e4568e2f05ea22fb49b48ccbf296c5f8fe3eb864 Mon Sep 17 00:00:00 2001 From: r888888888 Date: Tue, 23 Jul 2013 17:27:13 -0700 Subject: [PATCH] tweak Tag.trending algorithm --- app/models/tag.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/tag.rb b/app/models/tag.rb index ae6dd2407..84a1c94bb 100644 --- a/app/models/tag.rb +++ b/app/models/tag.rb @@ -124,10 +124,10 @@ class Tag < ActiveRecord::Base def trending Cache.get("popular-tags-v3", 1.hour) do CurrentUser.scoped(User.admins.first, "127.0.0.1") do - n = 8 + n = 24 counts = {} - while counts.empty? && n < 256 + while counts.empty? && n < 1000 tag_strings = Post.select_values_sql("select tag_string from posts where created_at >= ?", n.hours.ago) tag_strings.each do |tag_string| tag_string.scan(/\S+/).each do |tag|