In the indexer, skip destroyed `Status` objects.

master
multiple creatures 2019-11-17 02:55:56 -06:00
parent 296ec59fc9
commit 5ab70ad962
1 changed files with 6 additions and 1 deletions

View File

@ -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