1 添加

import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
@Bean
public static PropertySourcesPlaceholderConfigurer propertyConfigInDev() {
return new PropertySourcesPlaceholderConfigurer();//  //使spring能够识别 ${cron} 
}

@Scheduled(cron = "${cron}")//每隔5分钟执行一次
这样就可以了

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-04
  • 2022-12-23
  • 2021-10-03
  • 2022-02-14
  • 2021-06-26
猜你喜欢
  • 2022-12-23
  • 2021-12-27
  • 2021-09-29
  • 2022-12-23
  • 2022-02-16
  • 2022-12-23
相关资源
相似解决方案