zoukankan      html  css  js  c++  java
  • Springboot创建定时任务(可配置)

    @ApiModel("***定时任务")
    @Component
    @Configuration
    @EnableScheduling
    //@PropertySource("classpath:/***") // 可指定配置文件
    public class MatchOpenCheckScheduledTask { private final Logger log = LoggerFactory.getLogger(this.getClass()); @Scheduled(cron = "${open-check.cron}") public void openCheckTask(){ log.info("执行‘自动匹配开通校验’定时任务开始:" + FlowUtil.getCurrentDate("yyyy-MM-dd HH:mm:ss") ); long startTime = System.currentTimeMillis(); //获取开始时间   /**********************************************************************************************/


      /**********************************************************************************************/

    long endTime = System.currentTimeMillis(); //获取结束时间 log.info("执行‘自动匹配开通校验’定时任务结束:" + FlowUtil.getCurrentDate("yyyy-MM-dd HH:mm:ss") ); log.info("执行时间:"+(endTime - startTime)/1000+" 秒"); }

    在线Cron表达式生成器

        https://cron.qqe2.com/

  • 相关阅读:
    【leetcode】三维形体投影面积
    【leetcode】区域和检索
    【leetcode】二叉搜索树的范围和
    【leetcode】数组序号转换
    【leetcode】赎金信
    【leetcode】矩形重叠
    【leetcode】转变日期格式
    053-158
    053-268
    053-160
  • 原文地址:https://www.cnblogs.com/LittleMaster/p/14162156.html
Copyright © 2011-2022 走看看