update 优化 调整上传超时时间

dev
疯狂的狮子Li 5 months ago
parent f5729d040d
commit 30653c6d0f

@ -177,12 +177,12 @@ public class OssClient {
// 创建异步请求体length如果为空会报错
BlockingInputStreamAsyncRequestBody body = BlockingInputStreamAsyncRequestBody.builder()
.contentLength(length)
.subscribeTimeout(Duration.ofSeconds(30))
.subscribeTimeout(Duration.ofSeconds(120))
.build();
// 使用 transferManager 进行上传
Upload upload = transferManager.upload(
x -> x.requestBody(body)
x -> x.requestBody(body).addTransferListener(LoggingTransferListener.create())
.putObjectRequest(
y -> y.bucket(properties.getBucketName())
.key(key)

Loading…
Cancel
Save