mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
update 优化 调整上传超时时间
This commit is contained in:
@ -177,12 +177,12 @@ public class OssClient {
|
|||||||
// 创建异步请求体(length如果为空会报错)
|
// 创建异步请求体(length如果为空会报错)
|
||||||
BlockingInputStreamAsyncRequestBody body = BlockingInputStreamAsyncRequestBody.builder()
|
BlockingInputStreamAsyncRequestBody body = BlockingInputStreamAsyncRequestBody.builder()
|
||||||
.contentLength(length)
|
.contentLength(length)
|
||||||
.subscribeTimeout(Duration.ofSeconds(30))
|
.subscribeTimeout(Duration.ofSeconds(120))
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// 使用 transferManager 进行上传
|
// 使用 transferManager 进行上传
|
||||||
Upload upload = transferManager.upload(
|
Upload upload = transferManager.upload(
|
||||||
x -> x.requestBody(body)
|
x -> x.requestBody(body).addTransferListener(LoggingTransferListener.create())
|
||||||
.putObjectRequest(
|
.putObjectRequest(
|
||||||
y -> y.bucket(properties.getBucketName())
|
y -> y.bucket(properties.getBucketName())
|
||||||
.key(key)
|
.key(key)
|
||||||
|
Reference in New Issue
Block a user