increase min expiry for related tag cache to 1 hour

This commit is contained in:
albert
2013-02-19 11:22:14 -05:00
parent aebddd82e5
commit 08a72f8495
2 changed files with 4 additions and 2 deletions

View File

@@ -347,13 +347,15 @@ class Tag < ActiveRecord::Base
base = Math.sqrt([post_count, 0].max)
if base > 24
24
elsif base < 1
1
else
base
end
end
def should_update_related?
related_tags.blank? || related_tags_updated_at.blank? || related_tags_updated_at < related_cache_expiry.hours.ago
Delayed::Job.count < 200 && related_tags.blank? || related_tags_updated_at.blank? || related_tags_updated_at < related_cache_expiry.hours.ago
end
def related_tag_array

View File

@@ -6,7 +6,7 @@
<li><%= link_to "Hot", posts_path(:tags => "order:rank") %></li>
<% unless CurrentUser.is_anonymous? %>
<li><%= link_to "Favorites", favorites_path %></li>
<li><%= link_to "Subscriptions", posts_tag_subscription_path(CurrentUser.id) %></li>
<li><%= link_to "Subscriptions", posts_path(:tags => "sub:#{CurrentUser.name}") %></li>
<% end %>
<li class="nonessential"><%= link_to "Changes", post_versions_path %></li>
<% if CurrentUser.is_janitor? %>