Change preview card deletes to be done using batch method (#28183)
This commit is contained in:
		
				
					committed by
					
						
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							490e4969a1
						
					
				
				
					commit
					afc8550b63
				
			@@ -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
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user