LAPTOP-KB9HII50\70708 il y a 2 ans
Parent
commit
ec928699c9

+ 2 - 2
svr/svr-basic/src/main/java/com/yihu/jw/basic/config/AsyncConfig.java

@ -34,8 +34,8 @@ public class AsyncConfig {
     */
    private int keepAliveSeconds = 300;
    @Bean
    public Executor wlyyExecutor() {
    @Bean("wlyyExecutor")
    public ThreadPoolTaskExecutor wlyyExecutor() {
        ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
        executor.setCorePoolSize(corePoolSize);
        executor.setMaxPoolSize(maxPoolSize);

+ 2 - 1
svr/svr-basic/src/main/java/com/yihu/jw/basic/standard/service/adapter/AdapterDatasetService.java

@ -42,6 +42,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.io.IOException;
import java.util.*;
@ -57,7 +58,7 @@ public class AdapterDatasetService extends SQLGeneralDAO {
    @Autowired
    private AdapterSchemeVersionService adapterSchemeVersionService;
    @Autowired
    @Resource(name = "wlyyExecutor")
    private ThreadPoolTaskExecutor threadPoolTaskExecutor;
    @Autowired

+ 13 - 10
svr/svr-basic/src/main/resources/application.yml

@ -14,22 +14,25 @@ spring:
        enabled: false
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    max-active: 20
    max-idle: 8
    min-idle: 8
    validation-query: SELECT 1
    test-on-borrow: true
    hikari:
      maximum-pool-size: 200
      minimum-idle: 10
      connection-timeout: 60000 #连接超时时间(毫秒),默认值30秒.
      connection-test-query: SELECT 1
      idle-timeout: 60000 #连接超时时间(毫秒),默认值30秒.
      max-lifetime: 3000000 #连接最大存活时间,默认值30分钟.设置应该比mysql设置的超时时间短
  redis:
    database: 0 # Database index used by the connection factory.
    timeout: 0 # Connection timeout in milliseconds.
    #sentinel:
    #  master: # Name of Redis server.
    #  nodes: # Comma-separated list of host:port pairs.
    pool:
      max-active: 8 # Max number of connections that can be allocated by the pool at a given time. Use a negative value for no limit.
      max-idle: 8 # Max number of "idle" connections in the pool. Use a negative value to indicate an unlimited number of idle connections.
      max-wait: -1 # Maximum amount of time (in milliseconds) a connection allocation should block before throwing an exception when the pool is exhausted. Use a negative value to block indefinitely.
      min-idle: 1 # Target for the minimum number of idle connections to maintain in the pool. This setting only has an effect if it is positive.
    jedis:
      pool:
        max-active: 8 # Max number of connections that can be allocated by the pool at a given time. Use a negative value for no limit.
        max-idle: 8 # Max number of "idle" connections in the pool. Use a negative value to indicate an unlimited number of idle connections.
        max-wait: -1 # Maximum amount of time (in milliseconds) a connection allocation should block before throwing an exception when the pool is exhausted. Use a negative value to block indefinitely.
        min-idle: 1 # Target for the minimum number of idle connections to maintain in the pool. This setting only has an effect if it is positive.
fast-dfs:
  connect-timeout: 10