opt
This commit is contained in:
parent
31da1625f5
commit
343472f5cb
@ -57,13 +57,15 @@ public class MinioOSGatewayImpl implements ObjectStorageGateway {
|
||||
|
||||
@Override
|
||||
public void uploadFile(String bucket, String objectPath, MultipartFile file) throws Exception {
|
||||
long startMs = System.currentTimeMillis();
|
||||
localMinioClient.putObject(PutObjectArgs.builder()
|
||||
.bucket(bucket)
|
||||
.object(objectPath)
|
||||
.stream(file.getInputStream(), file.getSize(), -1)
|
||||
.contentType(Optional.ofNullable(file.getContentType()).orElse("application/octet-stream"))
|
||||
.build());
|
||||
log.info("上传成功: {}/{}", bucket, objectPath);
|
||||
long endMs = System.currentTimeMillis();
|
||||
log.info("上传成功: {}/{}, takes: {} ms", bucket, objectPath, (endMs - startMs));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user