diff --git a/jeecg-boot/jeecg-boot-module-KM/src/main/java/org/jeecg/modules/KM/service/impl/ThreadPoolExecutorService.java b/jeecg-boot/jeecg-boot-module-KM/src/main/java/org/jeecg/modules/KM/service/impl/ThreadPoolExecutorService.java index da7bc36..85fb261 100644 --- a/jeecg-boot/jeecg-boot-module-KM/src/main/java/org/jeecg/modules/KM/service/impl/ThreadPoolExecutorService.java +++ b/jeecg-boot/jeecg-boot-module-KM/src/main/java/org/jeecg/modules/KM/service/impl/ThreadPoolExecutorService.java @@ -12,31 +12,23 @@ import java.util.concurrent.TimeUnit; @Service public class ThreadPoolExecutorService implements IThreadPoolExecutorService { - private ThreadPoolExecutor poolExecutor; - private static LinkedBlockingDeque deque = new LinkedBlockingDeque(10000); + private static LinkedBlockingDeque deque = new LinkedBlockingDeque<>(10000); private static ThreadPoolExecutor singleExecutor =new ThreadPoolExecutor( - 5,10000, 20, TimeUnit.SECONDS,deque);; + 1,10000, 20, TimeUnit.SECONDS,deque); + private static ArrayBlockingQueue poolQueue = new ArrayBlockingQueue<>(10); + private static ThreadPoolExecutor poolExecutor=new ThreadPoolExecutor( + 5,20, 5, TimeUnit.SECONDS,poolQueue); private Logger logger= LoggerFactory.getLogger(ThreadPoolExecutorService.class); public ThreadPoolExecutorService(){ - ArrayBlockingQueue poolQeque = new ArrayBlockingQueue(10); - poolExecutor=new ThreadPoolExecutor( - 5,20, 5, TimeUnit.SECONDS,poolQeque); poolExecutor.allowCoreThreadTimeOut(true); - singleExecutor =new ThreadPoolExecutor( - 1,10000, 20, TimeUnit.SECONDS,deque); singleExecutor.allowCoreThreadTimeOut(true); } @Override public void singleExecute(Runnable runnable){ singleExecutor.execute(() -> { -// try { -// Thread.sleep(300); -// } catch (InterruptedException e) { -// e.printStackTrace(); -// } runnable.run(); }); } @@ -44,11 +36,6 @@ public class ThreadPoolExecutorService implements IThreadPoolExecutorService { @Override public void execute(Runnable runnable){ poolExecutor.execute(() -> { -// try { -// Thread.sleep(3000); -// } catch (InterruptedException e) { -// e.printStackTrace(); -// } runnable.run(); }); } @@ -62,7 +49,7 @@ public class ThreadPoolExecutorService implements IThreadPoolExecutorService { singleExecutor.getQueue().clear(); singleExecutor.shutdown(); singleExecutor.awaitTermination(10,TimeUnit.SECONDS); - } catch (InterruptedException e) { + } catch (Exception e) { logger.error("销毁线程池",e); } logger.info("销毁线程池"); diff --git a/jeecg-boot/jeecg-boot-module-system/src/main/resources/application-dev.yml b/jeecg-boot/jeecg-boot-module-system/src/main/resources/application-dev.yml index f8a71c7..2765002 100644 --- a/jeecg-boot/jeecg-boot-module-system/src/main/resources/application-dev.yml +++ b/jeecg-boot/jeecg-boot-module-system/src/main/resources/application-dev.yml @@ -27,10 +27,10 @@ base: ##ElasticSearch服务配置 for highLevelRestClient esclient: - master-host: 127.0.0.1 + master-host: 119.29.145.199 master-port: 9200 master-user-name: elastic - master-user-pwd: xxxxxxxxxxxxx + master-user-pwd: d1nyX77wMN4SrCpfYTrG spring: servlet: @@ -111,9 +111,9 @@ spring: connectionProperties: druid.stat.mergeSql\=true;druid.stat.slowSqlMillis\=5000 datasource: master: - url: jdbc:mysql://127.0.0.1:3306/km?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai + url: jdbc:mysql://119.29.145.199:6033/km_dev?characterEncoding=UTF-8&useUnicode=true&useSSL=false&tinyInt1isBit=false&allowPublicKeyRetrieval=true&serverTimezone=Asia/Shanghai username: root - password: xxxxxxxxxx + password: kyxxjs@2tencent driver-class-name: com.mysql.cj.jdbc.Driver #redis 配置 redis: