Merge commit '1dead10312caa0cc7719cb80052af549ddf3e6a1' into glitch-soc/merge-upstream

This commit is contained in:
Claire
2025-10-28 20:25:09 +01:00
131 changed files with 514 additions and 274 deletions

View File

@@ -17,12 +17,16 @@ class Vacuum::MediaAttachmentsVacuum
def vacuum_cached_files!
media_attachments_past_retention_period.find_in_batches do |media_attachments|
AttachmentBatch.new(MediaAttachment, media_attachments).clear
rescue => e
Rails.logger.error("Skipping batch while removing cached media attachments due to error: #{e}")
end
end
def vacuum_orphaned_records!
orphaned_media_attachments.find_in_batches do |media_attachments|
AttachmentBatch.new(MediaAttachment, media_attachments).delete
rescue => e
Rails.logger.error("Skipping batch while removing orphaned media attachments due to error: #{e}")
end
end

View File

@@ -16,6 +16,8 @@ class Vacuum::PreviewCardsVacuum
def vacuum_cached_images!
preview_cards_past_retention_period.find_in_batches do |preview_card|
AttachmentBatch.new(PreviewCard, preview_card).clear
rescue => e
Rails.logger.error("Skipping batch while removing cached preview cards due to error: #{e}")
end
end