ci: 配置 virtual thread

This commit is contained in:
CaptainB 2023-12-15 10:04:41 +08:00 committed by 刘瑞斌
parent f6eeb1150e
commit 65e9c45897
8 changed files with 16 additions and 26 deletions

View File

@ -52,7 +52,8 @@ mybatis.configuration.use-column-label=true
mybatis.configuration.auto-mapping-behavior=full mybatis.configuration.auto-mapping-behavior=full
mybatis.configuration.default-statement-timeout=25000 mybatis.configuration.default-statement-timeout=25000
mybatis.configuration.map-underscore-to-camel-case=true mybatis.configuration.map-underscore-to-camel-case=true
# virtual thread
spring.threads.virtual.enabled=true
# flyway enable # flyway enable
spring.flyway.enabled=true spring.flyway.enabled=true
spring.flyway.baseline-on-migrate=true spring.flyway.baseline-on-migrate=true

View File

@ -51,8 +51,8 @@ mybatis.configuration.use-column-label=true
mybatis.configuration.auto-mapping-behavior=full mybatis.configuration.auto-mapping-behavior=full
mybatis.configuration.default-statement-timeout=25000 mybatis.configuration.default-statement-timeout=25000
mybatis.configuration.map-underscore-to-camel-case=true mybatis.configuration.map-underscore-to-camel-case=true
# view # virtual thread
spring.mvc.throw-exception-if-no-handler-found=true spring.threads.virtual.enabled=true
# flyway enable # flyway enable
spring.flyway.enabled=true spring.flyway.enabled=true
spring.flyway.baseline-on-migrate=true spring.flyway.baseline-on-migrate=true

View File

@ -47,8 +47,8 @@ mybatis.configuration.use-column-label=true
mybatis.configuration.auto-mapping-behavior=full mybatis.configuration.auto-mapping-behavior=full
mybatis.configuration.default-statement-timeout=25000 mybatis.configuration.default-statement-timeout=25000
mybatis.configuration.map-underscore-to-camel-case=true mybatis.configuration.map-underscore-to-camel-case=true
# view # virtual thread
spring.mvc.throw-exception-if-no-handler-found=true spring.threads.virtual.enabled=true
# flyway enable # flyway enable
spring.flyway.enabled=true spring.flyway.enabled=true
spring.flyway.baseline-on-migrate=true spring.flyway.baseline-on-migrate=true

View File

@ -44,8 +44,8 @@ mybatis.configuration.use-column-label=true
mybatis.configuration.auto-mapping-behavior=full mybatis.configuration.auto-mapping-behavior=full
mybatis.configuration.default-statement-timeout=25000 mybatis.configuration.default-statement-timeout=25000
mybatis.configuration.map-underscore-to-camel-case=true mybatis.configuration.map-underscore-to-camel-case=true
# view # virtual thread
spring.mvc.throw-exception-if-no-handler-found=true spring.threads.virtual.enabled=true
# flyway enable # flyway enable
spring.flyway.enabled=true spring.flyway.enabled=true
spring.flyway.baseline-on-migrate=true spring.flyway.baseline-on-migrate=true

View File

@ -47,8 +47,8 @@ mybatis.configuration.use-column-label=true
mybatis.configuration.auto-mapping-behavior=full mybatis.configuration.auto-mapping-behavior=full
mybatis.configuration.default-statement-timeout=25000 mybatis.configuration.default-statement-timeout=25000
mybatis.configuration.map-underscore-to-camel-case=true mybatis.configuration.map-underscore-to-camel-case=true
# view # virtual thread
spring.mvc.throw-exception-if-no-handler-found=true spring.threads.virtual.enabled=true
# flyway enable # flyway enable
spring.flyway.enabled=true spring.flyway.enabled=true
spring.flyway.baseline-on-migrate=true spring.flyway.baseline-on-migrate=true

View File

@ -1,21 +1,10 @@
package io.metersphere.system.config; package io.metersphere.system.config;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration;
import org.springframework.core.task.AsyncTaskExecutor;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import java.util.concurrent.ThreadPoolExecutor;
@EnableAsync(proxyTargetClass = true) @EnableAsync(proxyTargetClass = true)
@Configuration
public class AsyncConfig { public class AsyncConfig {
@Bean
public AsyncTaskExecutor asyncTaskExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setThreadNamePrefix("Async-Executor-");
executor.setCorePoolSize(5);
executor.setRejectedExecutionHandler(new ThreadPoolExecutor.CallerRunsPolicy());
return executor;
}
} }

View File

@ -48,8 +48,8 @@ mybatis.configuration.use-column-label=true
mybatis.configuration.auto-mapping-behavior=full mybatis.configuration.auto-mapping-behavior=full
mybatis.configuration.default-statement-timeout=25000 mybatis.configuration.default-statement-timeout=25000
mybatis.configuration.map-underscore-to-camel-case=true mybatis.configuration.map-underscore-to-camel-case=true
# view # virtual thread
spring.mvc.throw-exception-if-no-handler-found=true spring.threads.virtual.enabled=true
# flyway enable # flyway enable
spring.flyway.enabled=true spring.flyway.enabled=true
spring.flyway.baseline-on-migrate=true spring.flyway.baseline-on-migrate=true

View File

@ -44,8 +44,8 @@ mybatis.configuration.use-column-label=true
mybatis.configuration.auto-mapping-behavior=full mybatis.configuration.auto-mapping-behavior=full
mybatis.configuration.default-statement-timeout=25000 mybatis.configuration.default-statement-timeout=25000
mybatis.configuration.map-underscore-to-camel-case=true mybatis.configuration.map-underscore-to-camel-case=true
# view # virtual thread
spring.mvc.throw-exception-if-no-handler-found=true spring.threads.virtual.enabled=true
# flyway enable # flyway enable
spring.flyway.enabled=true spring.flyway.enabled=true
spring.flyway.baseline-on-migrate=true spring.flyway.baseline-on-migrate=true