From c602624ed521d5c62db8c3754469cf5804f6aa92 Mon Sep 17 00:00:00 2001 From: albert Date: Sat, 2 Mar 2013 20:37:57 -0500 Subject: [PATCH] fix --- app/logical/post_sets/post.rb | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/app/logical/post_sets/post.rb b/app/logical/post_sets/post.rb index 204055e6d..be2d7b7e7 100644 --- a/app/logical/post_sets/post.rb +++ b/app/logical/post_sets/post.rb @@ -41,21 +41,13 @@ module PostSets if tag_array.size > 2 && !CurrentUser.is_privileged? raise SearchError.new("Upgrade your account to search more than two tags at once") end + + if tag_array.any? {|x| x =~ /^source:.*\*.*pixiv/} + raise SearchError.new("Your search took too long to execute and was canceled") + end @posts ||= begin - timeout = 3000 - if tag_string =~ /source:.*\*.*pixiv$/ - timeout = 300 - end - - 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? - temp = ::Post.where("FALSE").paginate(page) - end - + ::Post.tag_match(tag_string).paginate(page, :count => ::Post.fast_count(tag_string), :limit => per_page) temp.all temp end