From 709943b627e3d935d12d7b15634b77a7114a7381 Mon Sep 17 00:00:00 2001 From: r888888888 Date: Fri, 13 Mar 2015 18:01:47 -0700 Subject: [PATCH] timeout metatag query counts to 500ms --- app/models/post.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/post.rb b/app/models/post.rb index d76a496bb..32a802910 100644 --- a/app/models/post.rb +++ b/app/models/post.rb @@ -930,9 +930,10 @@ class Post < ActiveRecord::Base if tags.blank? && Danbooru.config.blank_tag_search_fast_count count = Danbooru.config.blank_tag_search_fast_count - elsif tags =~ /^rating:\S+$/ + elsif tags =~ /^-?rating:\S+$/ count = Danbooru.config.blank_tag_search_fast_count elsif tags =~ /(?:#{Tag::METATAGS}):/ + options[:statement_timeout] = 500 count = fast_count_search(tags, options) else count = get_count_from_cache(tags)