Increase HTTP read timeout for expensive S3 batch delete operation

This commit is contained in:
Claire 2025-11-20 16:55:07 +01:00
parent a28f1d0110
commit 7ba83d0a1d

View File

@ -112,10 +112,17 @@ class AttachmentBatch
keys.each_slice(LIMIT) do |keys_slice|
logger.debug { "Deleting #{keys_slice.size} objects" }
bucket.delete_objects(delete: {
bucket.delete_objects(
{
delete: {
objects: keys_slice.map { |key| { key: key } },
quiet: true,
})
},
},
{
http_read_timeout: [Paperclip::Attachment.default_options[:s3_options][:http_read_timeout], 120].max,
}
)
rescue => e
retries += 1