From 3696c2fbdd203b2dd62375639ec88df776918f41 Mon Sep 17 00:00:00 2001 From: zhengjie Date: Sun, 2 Jun 2019 16:04:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20druid=20=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?=E6=B1=A0=EF=BC=8C=E5=90=AF=E5=8A=A8=E7=B1=BB=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?@EnableAsync=E6=B3=A8=E8=A7=A3=EF=BC=8C=E5=BC=80=E5=90=AFSpring?= =?UTF-8?q?=20boot=20=E5=BC=82=E6=AD=A5=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/me/zhengjie/AppRun.java | 2 ++ .../main/resources/config/application-dev.yml | 28 ++++++++----------- .../resources/config/application-prod.yml | 27 ++++++++---------- 3 files changed, 26 insertions(+), 31 deletions(-) diff --git a/eladmin-system/src/main/java/me/zhengjie/AppRun.java b/eladmin-system/src/main/java/me/zhengjie/AppRun.java index 700a3a2..c578e14 100644 --- a/eladmin-system/src/main/java/me/zhengjie/AppRun.java +++ b/eladmin-system/src/main/java/me/zhengjie/AppRun.java @@ -4,6 +4,7 @@ import me.zhengjie.utils.SpringContextHolder; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.Bean; +import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker; @@ -11,6 +12,7 @@ import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBr * @author jie * @date 2018/11/15 9:20:19 */ +@EnableAsync @SpringBootApplication @EnableTransactionManagement @EnableWebSocketMessageBroker diff --git a/eladmin-system/src/main/resources/config/application-dev.yml b/eladmin-system/src/main/resources/config/application-dev.yml index 988b86d..866fc6e 100644 --- a/eladmin-system/src/main/resources/config/application-dev.yml +++ b/eladmin-system/src/main/resources/config/application-dev.yml @@ -8,27 +8,23 @@ spring: username: root password: 123456 - # 初始化连接大小 - initial-size: 5 - # 最小空闲连接数 - min-idle: 5 - max-active: 20 - max-wait: 30000 - # 可关闭的空闲连接间隔时间 - time-between-eviction-runs-millis: 60000 - # 配置连接在池中的最小生存时间 - min-evictable-idle-time-millis: 300000 - validation-query: select '1' from dual + # 初始化配置 + initial-size: 3 + # 最小连接数 + min-idle: 3 + # 最大连接数 + max-active: 15 + # 获取连接超时时间 + max-wait: 5000 + # 连接有效性检测时间 + time-between-eviction-runs-millis: 90000 + # 最大空闲时间 + min-evictable-idle-time-millis: 1800000 test-while-idle: true test-on-borrow: false test-on-return: false - # 打开PSCache,并且指定每个连接上PSCache的大小 - pool-prepared-statements: true - max-open-prepared-statements: 20 - max-pool-prepared-statement-per-connection-size: 20 # 配置监控统计拦截的filters filters: stat - stat-view-servlet: url-pattern: /druid/* reset-enable: false diff --git a/eladmin-system/src/main/resources/config/application-prod.yml b/eladmin-system/src/main/resources/config/application-prod.yml index 54d5d77..f8ad3c0 100644 --- a/eladmin-system/src/main/resources/config/application-prod.yml +++ b/eladmin-system/src/main/resources/config/application-prod.yml @@ -8,24 +8,21 @@ spring: username: root password: 123456 - # 初始化连接大小 - initial-size: 5 - # 最小空闲连接数 - min-idle: 5 - max-active: 20 - max-wait: 30000 - # 可关闭的空闲连接间隔时间 - time-between-eviction-runs-millis: 60000 - # 配置连接在池中的最小生存时间 - min-evictable-idle-time-millis: 300000 - validation-query: select '1' from dual + # 初始化配置 + initial-size: 3 + # 最小连接数 + min-idle: 3 + # 最大连接数 + max-active: 15 + # 获取连接超时时间 + max-wait: 5000 + # 连接有效性检测时间 + time-between-eviction-runs-millis: 90000 + # 最大空闲时间 + min-evictable-idle-time-millis: 1800000 test-while-idle: true test-on-borrow: false test-on-return: false - # 打开PSCache,并且指定每个连接上PSCache的大小 - pool-prepared-statements: true - max-open-prepared-statements: 20 - max-pool-prepared-statement-per-connection-size: 20 # 配置监控统计拦截的filters filters: stat -- GitLab