about summary refs log tree commit diff
path: root/lib/tasks
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-11-17 02:55:56 -0600
committermultiple creatures <dev@multiple-creature.party>2019-11-17 02:55:56 -0600
commit5ab70ad962481a2169593b81d15f86d1ea99653d (patch)
tree6060ed35910439af1f05256995da3b3d44444b56 /lib/tasks
parent296ec59fc93116dc177901c11640066b31b91438 (diff)
In the indexer, skip destroyed `Status` objects.
Diffstat (limited to 'lib/tasks')
-rw-r--r--lib/tasks/monsterfork.rake7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/tasks/monsterfork.rake b/lib/tasks/monsterfork.rake
index 11c5d86d9..00a0eaedb 100644
--- a/lib/tasks/monsterfork.rake
+++ b/lib/tasks/monsterfork.rake
@@ -11,7 +11,12 @@ namespace :monsterfork do
       ActiveRecord::Base.logger.silence do
         i += statuses.count
         statuses.each do |s|
-          s.update_column(:normalized_text, normalize_status(s, cache: false))
+          begin
+            next if s.destroyed?
+            s.update_column(:normalized_text, normalize_status(s, cache: false))
+          rescue rescue ActiveRecord::RecordNotFound
+            true
+          end
         end
       end
     end