Browse Source

解决S3上传文件时使用内容不对的问题

gitlink
Sydonian 11 months ago
parent
commit
234a6c267d
1 changed files with 3 additions and 4 deletions
  1. +3
    -4
      common/pkgs/storage/s3/shard_store.go

+ 3
- 4
common/pkgs/storage/s3/shard_store.go View File

@@ -197,10 +197,9 @@ func (s *ShardStore) createWithCalcSha256(stream io.Reader) (types.FileInfo, err
counter := io2.NewCounter(hashStr)

_, err := s.cli.PutObject(context.TODO(), &s3.PutObjectInput{
Bucket: aws.String(s.bucket),
Key: aws.String(key),
Body: counter,
ChecksumAlgorithm: s3types.ChecksumAlgorithmSha256,
Bucket: aws.String(s.bucket),
Key: aws.String(key),
Body: counter,
})
if err != nil {
log.Warnf("uploading file %v: %v", key, err)


Loading…
Cancel
Save