diff --git a/app/logical/post_sets/post.rb b/app/logical/post_sets/post.rb index 82e483ff0..8bf487421 100644 --- a/app/logical/post_sets/post.rb +++ b/app/logical/post_sets/post.rb @@ -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? diff --git a/app/models/post.rb b/app/models/post.rb index 0ef65e300..ea20e77c3 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -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)