burs/show: remove BUR update count estimate.

Remove the post update count estimate from BUR show pages. This was
complex, slow, and usually inaccurate since it assumed that requests in
a BUR had no overlap with each other, which usually wasn't the case.
This commit is contained in:
evazion
2020-02-16 19:17:46 -06:00
parent c4521acb54
commit 5817af4014
10 changed files with 0 additions and 105 deletions

View File

@@ -20,12 +20,6 @@ class TagBatchChangeJob < ApplicationJob
end
end
def self.estimate_update_count(antecedent, consequent)
CurrentUser.without_safe_mode do
Post.tag_match(antecedent).count
end
end
def migrate_posts(normalized_antecedent, normalized_consequent)
::Post.tag_match(normalized_antecedent.join(" ")).find_each do |post|
post.with_lock do

View File

@@ -78,24 +78,6 @@ class AliasAndImplicationImporter
end
end
def estimate_update_count
tokens = self.class.tokenize(text)
tokens.map do |token|
case token[0]
when :create_alias
TagAlias.new(antecedent_name: token[1], consequent_name: token[2]).estimate_update_count
when :create_implication
TagImplication.new(antecedent_name: token[1], consequent_name: token[2]).estimate_update_count
when :mass_update
TagBatchChangeJob.estimate_update_count(token[1], token[2])
when :change_category
Tag.find_by_name(token[1]).try(:post_count) || 0
else
0
end
end.sum
end
def affected_tags
tokens = self.class.tokenize(text)
tokens.inject([]) do |all, token|

View File

@@ -206,10 +206,6 @@ class BulkUpdateRequest < ApplicationRecord
status == "rejected"
end
def estimate_update_count
AliasAndImplicationImporter.new(script, nil).estimate_update_count
end
def update_notice
TagChangeNoticeService.update_cache(
AliasAndImplicationImporter.new(script, nil).affected_tags,

View File

@@ -198,10 +198,6 @@ class TagRelationship < ApplicationRecord
end
end
def estimate_update_count
Post.fast_count(antecedent_name, skip_cache: true)
end
def update_posts
Post.without_timeout do
Post.raw_tag_match(antecedent_name).find_each do |post|

View File

@@ -9,7 +9,6 @@
<li><strong>Creator</strong> <%= link_to_user @bulk_update_request.user %></li>
<li><strong>Date</strong> <%= @bulk_update_request.created_at %></li>
<li><strong>Status</strong>: <%= @bulk_update_request.status %></li>
<li><strong title="How many posts will be affected">Estimate</strong>: <%= @bulk_update_request.estimate_update_count %></li>
</ul>
<div style="margin: 1em 0;">