dsx 1 vuosi sitten
vanhempi
commit
dcf4ee4cbf

+ 1 - 0
src/main/java/com/fdkankan/download/Application.java

@@ -15,5 +15,6 @@ import org.springframework.scheduling.annotation.EnableAsync;
 public class Application {
     public static void main(String[] args) {
         SpringApplication.run(Application.class, args);
+        System.setProperty("java.util.concurrent.ForkJoinPool.common.parallelism", "64");
     }
 }

+ 2 - 0
src/main/java/com/fdkankan/download/entity/DownloadLog.java

@@ -52,6 +52,8 @@ public class DownloadLog implements Serializable {
 
     private Long interval;
 
+    private String host;
+
     private Timestamp createTime;
 
     private Timestamp updateTime;

+ 4 - 0
src/main/java/com/fdkankan/download/service/impl/DownloadLogServiceImpl.java

@@ -1,5 +1,7 @@
 package com.fdkankan.download.service.impl;
 
+import cn.hutool.system.HostInfo;
+import cn.hutool.system.SystemUtil;
 import com.fdkankan.common.constant.CommonSuccessStatus;
 import com.fdkankan.download.entity.DownloadLog;
 import com.fdkankan.download.mapper.DownloadLogMapper;
@@ -32,6 +34,8 @@ public class DownloadLogServiceImpl extends ServiceImpl<DownloadLogMapper, Downl
         downloadLog.setStatus(status);
         downloadLog.setReason(reason);
         downloadLog.setInterval(interval);
+        HostInfo hostInfo = SystemUtil.getHostInfo();
+        downloadLog.setHost(hostInfo.getAddress());
         this.save(downloadLog);
     }
 }

+ 2 - 0
src/main/java/com/fdkankan/download/service/impl/DownloadServiceImpl.java

@@ -225,7 +225,9 @@ public class DownloadServiceImpl implements IDownloadService {
 
         //切图
         String filePath = String.format(sourceLocal, num, this.wwwroot + String.format(UploadFilePath.IMG_VIEW_PATH, num) + "tiles/");
+        log.info("开始切图:{}", num);
         this.cutImg(num, filePath, resolution, "tiles");
+        log.info("结束切图:{}", num);
 
         //切图-场景关联
         String panoramaPath = String.format(sourceLocal, num, this.wwwroot + String.format(UploadFilePath.IMG_VIEW_PATH, num) + "panorama/");

+ 2 - 1
src/main/java/com/fdkankan/download/service/impl/GenSceneRunnerImpl.java

@@ -26,6 +26,7 @@ import org.springframework.stereotype.Component;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Set;
+import java.util.concurrent.LinkedBlockingQueue;
 import java.util.concurrent.ThreadPoolExecutor;
 import java.util.stream.Collectors;
 
@@ -52,7 +53,7 @@ public class GenSceneRunnerImpl implements CommandLineRunner {
     @Autowired
     private RabbitMqProducer mqProducer;
 
-    private final static ThreadPoolExecutor threadPoolExecutor = ExecutorBuilder.create().setCorePoolSize(30).setMaxPoolSize(30).build();
+    private final static ThreadPoolExecutor threadPoolExecutor = ExecutorBuilder.create().setWorkQueue(new LinkedBlockingQueue<>(10000)).setCorePoolSize(30).setMaxPoolSize(30).build();
 
     @Autowired
     ILaserService laserService;