mirror of
https://github.com/dutchcoders/transfer.sh.git
synced 2024-11-26 22:20:18 +01:00
Remove maxUploadParts and PartSize options
This commit is contained in:
parent
372ff5f368
commit
ce7e008bb3
3 changed files with 4 additions and 11 deletions
|
@ -163,9 +163,9 @@ provider | which storage provider to use | (s3, grdrive or local) |
|
|||
aws-access-key | aws access key | | AWS_ACCESS_KEY
|
||||
aws-secret-key | aws access key | | AWS_SECRET_KEY
|
||||
bucket | aws bucket | | BUCKET
|
||||
s3-endpoint | Custom S3 endpoint. | |
|
||||
s3-region | region of the s3 bucket | eu-west-1 | S3_REGION
|
||||
s3-no-multipart | disables s3 multipart upload | false | |
|
||||
s3-part-size | Size of parts for S3 multipart upload. | 5(MB) | |
|
||||
s3-path-style | Forces path style URLs, required for Minio. | false | |
|
||||
basedir | path storage for local/gdrive provider| |
|
||||
gdrive-client-json-filepath | path to oauth client json config for gdrive provider| |
|
||||
|
|
|
@ -130,11 +130,6 @@ var globalFlags = []cli.Flag{
|
|||
Name: "s3-no-multipart",
|
||||
Usage: "Disables S3 Multipart Puts",
|
||||
},
|
||||
cli.Int64Flag{
|
||||
Name: "s3-part-size",
|
||||
Usage: "Size of parts for S3 multipart upload, default 5(MB)",
|
||||
Value: 5,
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "s3-path-style",
|
||||
Usage: "Forces path style URLs, required for Minio.",
|
||||
|
|
|
@ -130,13 +130,12 @@ type S3Storage struct {
|
|||
s3 *s3.S3
|
||||
logger *log.Logger
|
||||
noMultipart bool
|
||||
partSize int64
|
||||
}
|
||||
|
||||
func NewS3Storage(accessKey, secretKey, bucketName, region, endpoint string, logger *log.Logger, disableMultipart bool, partSize int64, forcePathStyle bool) (*S3Storage, error) {
|
||||
func NewS3Storage(accessKey, secretKey, bucketName, region, endpoint string, logger *log.Logger, disableMultipart bool, forcePathStyle bool) (*S3Storage, error) {
|
||||
sess := getAwsSession(accessKey, secretKey, region, endpoint, forcePathStyle)
|
||||
|
||||
return &S3Storage{bucket: bucketName, s3: s3.New(sess), session: sess, logger: logger, noMultipart: disableMultipart, partSize: partSize}, nil
|
||||
return &S3Storage{bucket: bucketName, s3: s3.New(sess), session: sess, logger: logger, noMultipart: disableMultipart}, nil
|
||||
}
|
||||
|
||||
func (s *S3Storage) Type() string {
|
||||
|
@ -244,8 +243,7 @@ func (s *S3Storage) Put(token string, filename string, reader io.Reader, content
|
|||
|
||||
// Create an uploader with the session and custom options
|
||||
uploader := s3manager.NewUploader(s.session, func(u *s3manager.Uploader) {
|
||||
u.PartSize = s.partSize * 1024 * 1024 // The minimum/default allowed part size is 5MB
|
||||
u.Concurrency = concurrency // default is 5
|
||||
u.Concurrency = concurrency // default is 5
|
||||
u.LeavePartsOnError = false
|
||||
})
|
||||
|
||||
|
|
Loading…
Reference in a new issue