lianshufeng před 1 rokem
rodič
revize
cbad9c1012

+ 6 - 4
components/data/MongodbData/src/main/java/com/github/microservice/components/data/mongo/queue/timer/ExecQueueTimer.java

@@ -59,12 +59,14 @@ public class ExecQueueTimer implements ApplicationRunner {
 
     @Override
     public void run(ApplicationArguments args) throws Exception {
-        @Cleanup ResourceTokenService.Token token = this.resourceTokenService.token(RESOURCE_NAME);
-        executorService = Executors.newScheduledThreadPool(SystemUtil.getCpuCoreCount() * 2);
-        log.info("ExecQueueTimer start");
 
-        next();
+        new Thread(() -> {
+            ResourceTokenService.Token token = this.resourceTokenService.token(RESOURCE_NAME);
+            executorService = Executors.newScheduledThreadPool(SystemUtil.getCpuCoreCount() * 2);
+            log.info("ExecQueueTimer start");
+            next();
 
+        }).start();
     }
 
     private void next() {