ignore timeouts for reltagcalc

This commit is contained in:
albert
2013-04-03 20:49:28 -04:00
parent 4fef3aa9b2
commit d9da141489
2 changed files with 2 additions and 1 deletions

View File

@@ -1,6 +1,6 @@
class RelatedTagCalculator class RelatedTagCalculator
def self.find_tags(tag, limit) def self.find_tags(tag, limit)
Post.with_timeout(10_000, []) do Post.with_timeout(5_000, []) do
Post.tag_match(tag).limit(limit).select("posts.tag_string").reorder("posts.md5").map(&:tag_string) Post.tag_match(tag).limit(limit).select("posts.tag_string").reorder("posts.md5").map(&:tag_string)
end end
end end

View File

@@ -404,6 +404,7 @@ class Tag < ActiveRecord::Base
end end
self.related_tags_updated_at = Time.now self.related_tags_updated_at = Time.now
save save
rescue ActiveRecord::StatementInvalid
end end
def update_related_if_outdated def update_related_if_outdated