ソースを参照

代码规范调整-2-120220116

mashengyi 2 年 前
コミット
8d81bf691e

+ 9 - 2
src/main/java/com/jkcredit/invoice/component/StatisRequestIdTimeComp.java

@@ -1,12 +1,16 @@
 package com.jkcredit.invoice.component;
 
+import cn.hutool.core.thread.NamedThreadFactory;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.stereotype.Component;
 
 import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
 import java.util.Map;
-import java.util.concurrent.*;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.TimeUnit;
 
 @Component
 @Slf4j
@@ -25,13 +29,16 @@ public class StatisRequestIdTimeComp {
      * requestId 及 时间
      */
     public Map<String, Long> map = new ConcurrentHashMap<>();
-    ScheduledExecutorService service =new ScheduledThreadPoolExecutor(1);
+    ScheduledExecutorService service = new ScheduledThreadPoolExecutor(1,new NamedThreadFactory("STATIC_PROCESS_POOL",false));
     /**
      * 关注的请求时间秒
      */
     private byte costTimeAtten = 3;
     private int limitCount = 200;
 
+    public StatisRequestIdTimeComp() {
+    }
+
     /**
      * 放入requestid 及时间
      *