| | |
| | | package org.dromara.common.core.config; |
| | | |
| | | import jakarta.annotation.PreDestroy; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.dromara.common.core.config.properties.ThreadPoolProperties; |
| | | import org.dromara.common.core.utils.Threads; |
| | | import org.apache.commons.lang3.concurrent.BasicThreadFactory; |
| | | import org.springframework.beans.factory.annotation.Qualifier; |
| | | import org.springframework.boot.autoconfigure.AutoConfiguration; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.boot.context.properties.EnableConfigurationProperties; |
| | |
| | | * |
| | | * @author Lion Li |
| | | **/ |
| | | @Slf4j |
| | | @AutoConfiguration |
| | | @EnableConfigurationProperties(ThreadPoolProperties.class) |
| | | public class ThreadPoolConfig { |
| | |
| | | } |
| | | }; |
| | | } |
| | | |
| | | /** |
| | | * 鿝äºä»¶ |
| | | */ |
| | | @PreDestroy |
| | | public void destroy(@Qualifier("scheduledExecutorService") ScheduledExecutorService scheduledExecutorService) { |
| | | try { |
| | | log.info("====å
³éåå°ä»»å¡ä»»å¡çº¿ç¨æ± ===="); |
| | | Threads.shutdownAndAwaitTermination(scheduledExecutorService); |
| | | } catch (Exception e) { |
| | | log.error(e.getMessage(), e); |
| | | } |
| | | } |
| | | |
| | | } |