Remove debug code

This commit is contained in:
Stanko K.R.
2026-02-02 21:33:48 +01:00
parent e0c3e09aa9
commit 5eb15ebf4d
+13 -35
View File
@@ -40,41 +40,19 @@ class ZipFile
writer = Writer.new
begin
if defined?(Sentry)
Sentry.add_breadcrumb(Sentry::Breadcrumb.new(
category: "zip_file.upload",
message: "Starting S3 multipart upload",
data: { blob_key: blob.key, service: service.class.name }
))
end
# Use S3's upload_stream directly for write-based streaming.
# ActiveStorage's upload method expects a read-based IO, but ZipKit
# needs a write-based stream. The TransferManager's upload_stream
# yields a writable IO that we can stream directly to.
service.send(:upload_stream,
key: blob.key,
content_type: "application/zip",
part_size: 100.megabytes
) do |write_stream|
write_stream.binmode
writer.stream_to(write_stream)
yield writer
writer.close
end
rescue Aws::S3::MultipartUploadError => e
# Add context to help diagnose the issue
if defined?(Sentry)
Sentry.set_context("zip_file_upload", {
blob_key: blob.key,
writer_byte_size: writer.byte_size,
error_class: e.class.name,
error_message: e.message,
nested_errors: e.errors.map { |err| { class: err.class.name, message: err.message } }
})
end
raise
# Use S3's upload_stream directly for write-based streaming.
# ActiveStorage's upload method expects a read-based IO, but ZipKit
# needs a write-based stream. The TransferManager's upload_stream
# yields a writable IO that we can stream directly to.
service.send(:upload_stream,
key: blob.key,
content_type: "application/zip",
part_size: 100.megabytes
) do |write_stream|
write_stream.binmode
writer.stream_to(write_stream)
yield writer
writer.close
end
blob.update!(byte_size: writer.byte_size, checksum: writer.checksum)