This commit is contained in:
albert
2013-03-05 19:43:49 -05:00
parent 3621edd357
commit 29e3e7be0e
2 changed files with 3 additions and 15 deletions

View File

@@ -42,26 +42,15 @@ module PostSets
raise SearchError.new("Upgrade your account to search more than two tags at once")
end
timeout = 3000
if tag_array.any? {|x| x =~ /^source:.*\*.*pixiv/}
timeout = 1000
if tag_array.any? {|x| x =~ /^source:.*\*.*pixiv/} && !CurrentUser.user.is_builder?
raise SearchError.new("Your search took too long to execute and was canceled")
end
@posts ||= begin
temp = ::Post.with_timeout(timeout, nil) do
::Post.tag_match(tag_string).paginate(page, :count => ::Post.fast_count(tag_string), :limit => per_page)
end
if temp.nil?
raise SearchError.new("Your search took too long to execute and was canceled")
end
::Post.tag_match(tag_string).paginate(page, :count => ::Post.fast_count(tag_string), :limit => per_page)
temp.all
temp
end
rescue ::Post::SearchError
@posts = ::Post.where("false")
end
def has_artist?

View File

@@ -846,7 +846,6 @@ class Post < ActiveRecord::Base
def to_xml(options = {}, &block)
# to_xml ignores the serializable_hash method
options ||= {}
options[:methods] = [:uploader_name, :has_large]
options[:except] ||= []
options[:except] += hidden_attributes
super(options, &block)