处理一些合并冲突
This commit is contained in:
@@ -6,15 +6,21 @@ import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.scheduling.TaskScheduler;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
||||
|
||||
import java.time.Clock;
|
||||
import java.time.ZoneId;
|
||||
|
||||
@Configuration
|
||||
@Slf4j
|
||||
public class SchedulingConfig {
|
||||
|
||||
private static final ZoneId BUSINESS_ZONE = ZoneId.of("Asia/Shanghai");
|
||||
|
||||
@Bean
|
||||
public TaskScheduler taskScheduler() {
|
||||
ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
|
||||
scheduler.setPoolSize(4);
|
||||
scheduler.setThreadNamePrefix("aiimage-scheduling-");
|
||||
scheduler.setClock(Clock.system(BUSINESS_ZONE));
|
||||
scheduler.setWaitForTasksToCompleteOnShutdown(true);
|
||||
scheduler.setAwaitTerminationSeconds(30);
|
||||
scheduler.setErrorHandler(ex -> log.warn("[scheduling] task execution failed: {}", ex.getMessage(), ex));
|
||||
|
||||
Reference in New Issue
Block a user