From db3983f487e13e2fdf236011c4a9017c599b9ef0 Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 3 Dec 2020 17:25:20 -0600 Subject: [PATCH] implications: disable timeout when checking tag count. --- app/models/tag_implication.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/tag_implication.rb b/app/models/tag_implication.rb index 16910e96d..e400cdee2 100644 --- a/app/models/tag_implication.rb +++ b/app/models/tag_implication.rb @@ -119,7 +119,7 @@ class TagImplication < TagRelationship errors[:base] << "'#{antecedent_name}' must have at least #{(MINIMUM_TAG_PERCENTAGE * consequent_tag.post_count).to_i} posts" end - max_count = MAXIMUM_TAG_PERCENTAGE * PostQueryBuilder.new("~#{antecedent_name} ~#{consequent_name}").fast_count.to_i + max_count = MAXIMUM_TAG_PERCENTAGE * PostQueryBuilder.new("~#{antecedent_name} ~#{consequent_name}").fast_count(timeout: 0).to_i if antecedent_tag.post_count > max_count && max_count > 0 errors[:base] << "'#{antecedent_name}' can't make up than #{(MAXIMUM_TAG_PERCENTAGE * 100).to_i}% of '#{consequent_name}'" end