package top.baogutang.common.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.TaskScheduler;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;

import javax.annotation.Resource;

/**
 * @description: 定时调度任务线程配置
 * @author: nikooh
 * @date: 2024/01/09 : 17:56
 */
@Configuration
public class ScheduleConfig implements SchedulingConfigurer {

    @Resource(name = "taskExecutor")
    private TaskScheduler taskScheduler;


    @Override
    public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {

        scheduledTaskRegistrar.setScheduler(taskScheduler);
    }
}
