Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
xiaofang li
MeterSphere
Commits
3229773d
Commit
3229773d
authored
3 years ago
by
Captain.B
Committed by
刘瑞斌
3 years ago
Browse files
Options
Download
Email Patches
Plain Diff
refactor: 修改异步方法的配置
parent
591a3836
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
backend/src/main/java/io/metersphere/Application.java
+0
-2
backend/src/main/java/io/metersphere/Application.java
backend/src/main/java/io/metersphere/config/AsyncConfig.java
+5
-3
backend/src/main/java/io/metersphere/config/AsyncConfig.java
with
5 additions
and
5 deletions
+5
-5
backend/src/main/java/io/metersphere/Application.java
+
0
-
2
View file @
3229773d
...
...
@@ -10,7 +10,6 @@ import org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.boot.web.servlet.ServletComponentScan
;
import
org.springframework.context.annotation.PropertySource
;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.annotation.EnableScheduling
;
@SpringBootApplication
(
exclude
=
{
...
...
@@ -24,7 +23,6 @@ import org.springframework.scheduling.annotation.EnableScheduling;
JmeterProperties
.
class
})
@EnableScheduling
@EnableAsync
(
proxyTargetClass
=
true
)
//@PropertySource(value = {"file:c:\\opt\\metersphere\\conf\\metersphere.properties"}, encoding = "UTF-8", ignoreResourceNotFound = true)
@PropertySource
(
value
=
{
"file:/opt/metersphere/conf/metersphere.properties"
},
encoding
=
"UTF-8"
,
ignoreResourceNotFound
=
true
)
public
class
Application
{
...
...
This diff is collapsed.
Click to expand it.
backend/src/main/java/io/metersphere/config/AsyncConfig.java
+
5
-
3
View file @
3229773d
...
...
@@ -6,6 +6,8 @@ import org.springframework.core.task.AsyncTaskExecutor;
import
org.springframework.scheduling.annotation.EnableAsync
;
import
org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor
;
import
java.util.concurrent.ThreadPoolExecutor
;
@EnableAsync
(
proxyTargetClass
=
true
)
@Configuration
public
class
AsyncConfig
{
...
...
@@ -13,9 +15,9 @@ public class AsyncConfig {
@Bean
public
AsyncTaskExecutor
taskExecutor
()
{
ThreadPoolTaskExecutor
executor
=
new
ThreadPoolTaskExecutor
();
executor
.
setThreadNamePrefix
(
"Async-Executor"
);
executor
.
setCorePoolSize
(
5
);
executor
.
set
MaxPoolSize
(
10
);
executor
.
setThreadNamePrefix
(
"Async-Executor
-
"
);
executor
.
setCorePoolSize
(
10
);
executor
.
set
RejectedExecutionHandler
(
new
ThreadPoolExecutor
.
CallerRunsPolicy
()
);
return
executor
;
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help