about summary refs log tree commit diff
path: root/lib/tasks
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2020-01-10 04:14:37 -0600
committermultiple creatures <dev@multiple-creature.party>2020-01-10 04:14:37 -0600
commita29fb04e7c1c7a719a29f40da275d4981ef2ebb5 (patch)
tree87eaab291a77a3056938bdc5410bd90818044e08 /lib/tasks
parentf03960382bd05b8570e0e3b1066545831c59138a (diff)
bon voyage to that shitty text normalization code
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/monsterfork.rake42
1 files changed, 0 insertions, 42 deletions
diff --git a/lib/tasks/monsterfork.rake b/lib/tasks/monsterfork.rake
index 14e001f4b..a5a5ea434 100644
--- a/lib/tasks/monsterfork.rake
+++ b/lib/tasks/monsterfork.rake
@@ -1,48 +1,6 @@
 # frozen_string_literal: true
 
-def index_statuses(statuses_query)
-  include TextHelper
-
-  i = 0
-  total = statuses_query.count
-
-  statuses_query.find_in_batches do |statuses|
-    ActiveRecord::Base.logger.info("Indexing status #{1+i} of #{total}.")
-    ActiveRecord::Base.logger.silence do
-      i += statuses.count
-      statuses.each do |s|
-        begin
-          next if s.destroyed?
-          normalized_text = normalize_status(s)
-          if s.normalized_status.nil?
-            s.create_normalized_status(text: normalized_text)
-          elsif s.normalized_status.text != normalized_text
-            s.normalized_status.update_column(:text, normalized_text)
-          end
-        rescue ActiveRecord::RecordNotFound
-          true
-        end
-      end
-    end
-  end
-end
-
 namespace :monsterfork do
-  desc 'Index statuses for search that have not been indexed yet.'
-  task index_statuses: :environment do
-    index_statuses(Status.where(normalized_text: ''))
-  end
-
-  desc 'Reindex all statuses for search.'
-  task reindex_statuses: :environment do
-    index_statuses(Status)
-  end
-
-  desc 'Reindex statuses containing media with descriptions for search.'
-  task reindex_media_descs: :environment do
-    index_statuses(Status.left_outer_joins(:media_attachments).where('media_attachments.description IS NOT NULL'))
-  end
-
   desc "Re-apply all users' filters to their home and list timelines."
   task reapply_filters: :environment do
     Account.local.find_each do |account|