mirror of
https://gitee.com/dcren/initializr.git
synced 2025-07-30 22:10:25 +08:00
Complete migration to Spring Boot 2.1.0
This commit is contained in:
parent
27d3514687
commit
c05ed7cf38
@ -16,8 +16,6 @@
|
||||
|
||||
package io.spring.initializr.service;
|
||||
|
||||
import java.util.concurrent.Executor;
|
||||
|
||||
import io.spring.initializr.metadata.InitializrMetadataProvider;
|
||||
import io.spring.initializr.web.project.LegacyStsController;
|
||||
|
||||
@ -25,10 +23,7 @@ import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.cache.annotation.EnableCaching;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.annotation.AsyncConfigurerSupport;
|
||||
import org.springframework.scheduling.annotation.EnableAsync;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
|
||||
import org.springframework.web.servlet.resource.ResourceUrlProvider;
|
||||
|
||||
/**
|
||||
@ -38,6 +33,7 @@ import org.springframework.web.servlet.resource.ResourceUrlProvider;
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableCaching
|
||||
@EnableAsync
|
||||
public class InitializrService {
|
||||
|
||||
public static void main(String[] args) {
|
||||
@ -51,23 +47,4 @@ public class InitializrService {
|
||||
return new LegacyStsController(metadataProvider, resourceUrlProvider);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@link Executor} configuration for event processing.
|
||||
*/
|
||||
@Configuration
|
||||
@EnableAsync
|
||||
static class AsyncConfiguration extends AsyncConfigurerSupport {
|
||||
|
||||
@Override
|
||||
public Executor getAsyncExecutor() {
|
||||
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
|
||||
executor.setCorePoolSize(1);
|
||||
executor.setMaxPoolSize(5);
|
||||
executor.setThreadNamePrefix("initializr-");
|
||||
executor.initialize();
|
||||
return executor;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -23,6 +23,9 @@ spring:
|
||||
strategy:
|
||||
content:
|
||||
enabled: true
|
||||
task:
|
||||
execution:
|
||||
thread-name-prefix: initializr-
|
||||
|
||||
initializr:
|
||||
env:
|
||||
|
Loading…
Reference in New Issue
Block a user