zoukankan      html  css  js  c++  java
  • Spring Boot定时任务配置

    import org.springframework.context.annotation.Configuration;
    import org.springframework.scheduling.annotation.EnableScheduling;
    import org.springframework.scheduling.annotation.Scheduled;
    import org.springframework.stereotype.Component;
    
    /**
     * @author yvioo
     */
    
    @Component
    @Configuration      //主要用于标记配置类,兼备Component的效果。
    @EnableScheduling   // 开启定时任务
    public class ScheduleTask {
    
        /**
         *  corn表达式 
         * 每天0点执行
         */
        @Scheduled(cron = "0 0 0 */1 * ?")
        private void configureTasks() {
            System.err.println("定时任务执行");
        }
    }
    -----------------------有任何问题可以在评论区评论,也可以私信我,我看到的话会进行回复,欢迎大家指教------------------------ (蓝奏云官网有些地址失效了,需要把请求地址lanzous改成lanzoux才可以)
  • 相关阅读:
    Hdu3022 Sum of Digits
    bzoj3864 Hero meet devil
    bzoj2448 挖油
    poj3783 Balls
    bzoj3802 Vocabulary
    Hdu5181 numbers
    Hdu5693 D Game
    图形填充之边标志算法
    图形填充之栅栏填充算法
    图形填充之种子填充算法
  • 原文地址:https://www.cnblogs.com/pxblog/p/14540641.html
Copyright © 2011-2022 走看看