lyhzzz 2 months ago
parent
commit
4e3f9a2a3f

+ 1 - 8
src/main/java/com/fdkankan/rmnas/config/ThreadPoolConfig.java

@@ -5,20 +5,13 @@ import org.springframework.context.annotation.Configuration;
 
 import java.util.concurrent.*;
 
-/**
- * 线程池配置 - 用于 NAS/OSS 批量删除等 IO 密集型任务
- */
 @Configuration
 public class ThreadPoolConfig {
 
-    /**
-     * IO 密集型任务线程池
-     * 线程数 = 2 * CPU核数,适合网络上传、文件删除等阻塞操作
-     */
     @Bean("ioTaskExecutor")
     public ExecutorService ioTaskExecutor() {
         int cores = Runtime.getRuntime().availableProcessors();
-        int poolSize = Math.max(cores , 5); // 至少 10 个线程
+        int poolSize = Math.max(cores , 5);
 
         ThreadPoolExecutor executor = new ThreadPoolExecutor(
                 poolSize,

+ 1 - 1
src/main/java/com/fdkankan/rmnas/task/TaskController.java

@@ -27,7 +27,7 @@ public class TaskController {
     TaskService taskService;
 
     //@Scheduled(cron = "0 0 0 * * ?")
-    @Scheduled(initialDelay = 2000,fixedDelay = 1000 * 60 * 60 *24*10)
+    @Scheduled(initialDelay = 2000,fixedDelay = 1000 * 60 * 60 * 24)
     public void start() throws InterruptedException {
         Long start = System.currentTimeMillis();
         log.info("项目启动执行开始删除nas资源命令:{}",CacheUtil.runVersion);