Change preview card deletes to be done using batch method (#28183)

th-downstream
Michael Stanclift 11 months ago committed by GitHub
parent 490e4969a1
commit afc8550b63
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -14,9 +14,8 @@ class Vacuum::PreviewCardsVacuum
private
def vacuum_cached_images!
preview_cards_past_retention_period.find_each do |preview_card|
preview_card.image.destroy
preview_card.save
preview_cards_past_retention_period.find_in_batches do |preview_card|
AttachmentBatch.new(PreviewCard, preview_card).clear
end
end

Loading…
Cancel
Save