From 65e9c45897d1ecd2503bfcb9de5f1b33bcb5d26c Mon Sep 17 00:00:00 2001 From: CaptainB Date: Fri, 15 Dec 2023 10:04:41 +0800 Subject: [PATCH] =?UTF-8?q?ci:=20=E9=85=8D=E7=BD=AE=20virtual=20thread?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/src/main/resources/commons.properties | 3 ++- .../src/test/resources/application.properties | 4 ++-- .../src/test/resources/application.properties | 4 ++-- .../src/test/resources/application.properties | 4 ++-- .../src/test/resources/application.properties | 4 ++-- .../io/metersphere/system/config/AsyncConfig.java | 15 ++------------- .../src/test/resources/application.properties | 4 ++-- .../src/test/resources/application.properties | 4 ++-- 8 files changed, 16 insertions(+), 26 deletions(-) diff --git a/backend/app/src/main/resources/commons.properties b/backend/app/src/main/resources/commons.properties index 5ba3529b69..3f088aea09 100644 --- a/backend/app/src/main/resources/commons.properties +++ b/backend/app/src/main/resources/commons.properties @@ -52,7 +52,8 @@ mybatis.configuration.use-column-label=true mybatis.configuration.auto-mapping-behavior=full mybatis.configuration.default-statement-timeout=25000 mybatis.configuration.map-underscore-to-camel-case=true - +# virtual thread +spring.threads.virtual.enabled=true # flyway enable spring.flyway.enabled=true spring.flyway.baseline-on-migrate=true diff --git a/backend/services/api-test/src/test/resources/application.properties b/backend/services/api-test/src/test/resources/application.properties index c410f98afd..835d85ef69 100644 --- a/backend/services/api-test/src/test/resources/application.properties +++ b/backend/services/api-test/src/test/resources/application.properties @@ -51,8 +51,8 @@ mybatis.configuration.use-column-label=true mybatis.configuration.auto-mapping-behavior=full mybatis.configuration.default-statement-timeout=25000 mybatis.configuration.map-underscore-to-camel-case=true -# view -spring.mvc.throw-exception-if-no-handler-found=true +# virtual thread +spring.threads.virtual.enabled=true # flyway enable spring.flyway.enabled=true spring.flyway.baseline-on-migrate=true diff --git a/backend/services/bug-management/src/test/resources/application.properties b/backend/services/bug-management/src/test/resources/application.properties index 6c7dc12130..7a4a830ad6 100644 --- a/backend/services/bug-management/src/test/resources/application.properties +++ b/backend/services/bug-management/src/test/resources/application.properties @@ -47,8 +47,8 @@ mybatis.configuration.use-column-label=true mybatis.configuration.auto-mapping-behavior=full mybatis.configuration.default-statement-timeout=25000 mybatis.configuration.map-underscore-to-camel-case=true -# view -spring.mvc.throw-exception-if-no-handler-found=true +# virtual thread +spring.threads.virtual.enabled=true # flyway enable spring.flyway.enabled=true spring.flyway.baseline-on-migrate=true diff --git a/backend/services/case-management/src/test/resources/application.properties b/backend/services/case-management/src/test/resources/application.properties index 35945bdfcd..7e56d69080 100644 --- a/backend/services/case-management/src/test/resources/application.properties +++ b/backend/services/case-management/src/test/resources/application.properties @@ -44,8 +44,8 @@ mybatis.configuration.use-column-label=true mybatis.configuration.auto-mapping-behavior=full mybatis.configuration.default-statement-timeout=25000 mybatis.configuration.map-underscore-to-camel-case=true -# view -spring.mvc.throw-exception-if-no-handler-found=true +# virtual thread +spring.threads.virtual.enabled=true # flyway enable spring.flyway.enabled=true spring.flyway.baseline-on-migrate=true diff --git a/backend/services/project-management/src/test/resources/application.properties b/backend/services/project-management/src/test/resources/application.properties index 64134943e1..e1cb6dbd16 100644 --- a/backend/services/project-management/src/test/resources/application.properties +++ b/backend/services/project-management/src/test/resources/application.properties @@ -47,8 +47,8 @@ mybatis.configuration.use-column-label=true mybatis.configuration.auto-mapping-behavior=full mybatis.configuration.default-statement-timeout=25000 mybatis.configuration.map-underscore-to-camel-case=true -# view -spring.mvc.throw-exception-if-no-handler-found=true +# virtual thread +spring.threads.virtual.enabled=true # flyway enable spring.flyway.enabled=true spring.flyway.baseline-on-migrate=true diff --git a/backend/services/system-setting/src/main/java/io/metersphere/system/config/AsyncConfig.java b/backend/services/system-setting/src/main/java/io/metersphere/system/config/AsyncConfig.java index 3b99317c73..af54f98e65 100644 --- a/backend/services/system-setting/src/main/java/io/metersphere/system/config/AsyncConfig.java +++ b/backend/services/system-setting/src/main/java/io/metersphere/system/config/AsyncConfig.java @@ -1,21 +1,10 @@ package io.metersphere.system.config; -import org.springframework.context.annotation.Bean; -import org.springframework.core.task.AsyncTaskExecutor; +import org.springframework.context.annotation.Configuration; import org.springframework.scheduling.annotation.EnableAsync; -import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; - -import java.util.concurrent.ThreadPoolExecutor; @EnableAsync(proxyTargetClass = true) +@Configuration 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; - } } diff --git a/backend/services/system-setting/src/test/resources/application.properties b/backend/services/system-setting/src/test/resources/application.properties index 6561b0ec53..ae3de81c9e 100644 --- a/backend/services/system-setting/src/test/resources/application.properties +++ b/backend/services/system-setting/src/test/resources/application.properties @@ -48,8 +48,8 @@ mybatis.configuration.use-column-label=true mybatis.configuration.auto-mapping-behavior=full mybatis.configuration.default-statement-timeout=25000 mybatis.configuration.map-underscore-to-camel-case=true -# view -spring.mvc.throw-exception-if-no-handler-found=true +# virtual thread +spring.threads.virtual.enabled=true # flyway enable spring.flyway.enabled=true spring.flyway.baseline-on-migrate=true diff --git a/backend/services/test-plan/src/test/resources/application.properties b/backend/services/test-plan/src/test/resources/application.properties index 478be602ab..f28d3af0b3 100644 --- a/backend/services/test-plan/src/test/resources/application.properties +++ b/backend/services/test-plan/src/test/resources/application.properties @@ -44,8 +44,8 @@ mybatis.configuration.use-column-label=true mybatis.configuration.auto-mapping-behavior=full mybatis.configuration.default-statement-timeout=25000 mybatis.configuration.map-underscore-to-camel-case=true -# view -spring.mvc.throw-exception-if-no-handler-found=true +# virtual thread +spring.threads.virtual.enabled=true # flyway enable spring.flyway.enabled=true spring.flyway.baseline-on-migrate=true