increase min expiry for related tag cache to 1 hour
This commit is contained in:
@@ -347,13 +347,15 @@ class Tag < ActiveRecord::Base
|
|||||||
base = Math.sqrt([post_count, 0].max)
|
base = Math.sqrt([post_count, 0].max)
|
||||||
if base > 24
|
if base > 24
|
||||||
24
|
24
|
||||||
|
elsif base < 1
|
||||||
|
1
|
||||||
else
|
else
|
||||||
base
|
base
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def should_update_related?
|
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
|
end
|
||||||
|
|
||||||
def related_tag_array
|
def related_tag_array
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<li><%= link_to "Hot", posts_path(:tags => "order:rank") %></li>
|
<li><%= link_to "Hot", posts_path(:tags => "order:rank") %></li>
|
||||||
<% unless CurrentUser.is_anonymous? %>
|
<% unless CurrentUser.is_anonymous? %>
|
||||||
<li><%= link_to "Favorites", favorites_path %></li>
|
<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 %>
|
<% end %>
|
||||||
<li class="nonessential"><%= link_to "Changes", post_versions_path %></li>
|
<li class="nonessential"><%= link_to "Changes", post_versions_path %></li>
|
||||||
<% if CurrentUser.is_janitor? %>
|
<% if CurrentUser.is_janitor? %>
|
||||||
|
|||||||
Reference in New Issue
Block a user