09-29-上传时间改为120秒,上传时删除原文件使用日志记录

This commit is contained in:
2025-09-29 15:19:51 +08:00
parent d644df94dc
commit 9fe3cd494f
2 changed files with 4 additions and 2 deletions

View File

@ -183,7 +183,7 @@ public class OssClient {
// 创建异步请求体length如果为空会报错
BlockingInputStreamAsyncRequestBody body = BlockingInputStreamAsyncRequestBody.builder()
.contentLength(length)
.subscribeTimeout(Duration.ofSeconds(30))
.subscribeTimeout(Duration.ofSeconds(120)) // 增加超时时间到120秒
.build();
// 使用 transferManager 进行上传

View File

@ -1,6 +1,7 @@
package org.dromara.app.controller;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.extern.slf4j.Slf4j;
import org.dromara.app.domain.SysPackage;
import org.dromara.app.service.SysPackageServiceImpl;
import org.dromara.common.core.domain.R;
@ -15,6 +16,7 @@ import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@Slf4j
@RestController
@RequestMapping("/app/sysPackage")
public class SysPackageController {
@ -52,7 +54,7 @@ public class SysPackageController {
SysPackage first = list.getFirst();
Boolean b = sysOssService.deleteWithValidByIds(List.of(first.getFileId()), false);
if (!b){
return R.fail("删除文件失败");
log.error("通过IDS删除文件失败");
}
}