mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Limit list multipart parts to 1 (#14853)
We are only using list_multipart_parts right now in the uploads controller for multipart uploads to check if the upload exists; thus we don't need up to 1000 parts. Also adding a note for future explorers that list_multipart_parts only gets 1000 parts max, and adding params for max parts and starting parts.
This commit is contained in:
@@ -372,7 +372,9 @@ class UploadsController < ApplicationController
|
||||
def multipart_upload_exists?(external_upload_stub)
|
||||
begin
|
||||
Discourse.store.list_multipart_parts(
|
||||
upload_id: external_upload_stub.external_upload_identifier, key: external_upload_stub.key
|
||||
upload_id: external_upload_stub.external_upload_identifier,
|
||||
key: external_upload_stub.key,
|
||||
max_parts: 1
|
||||
)
|
||||
rescue Aws::S3::Errors::NoSuchUpload => err
|
||||
debug_upload_error(err, "upload.external_upload_not_found", { additional_detail: "path: #{external_upload_stub.key}" })
|
||||
|
||||
Reference in New Issue
Block a user