In the indexer, skip destroyed `Status` objects.
parent
296ec59fc9
commit
5ab70ad962
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue