【Spring Boot采坑记】- 定时任务之 @Scheduled

Spring 定时任务 @Scheduled

@Scheduled(cron = "${timer.test-sync-time-task}")

1.错误示范

timer:
  test-sync-time-task: 0 /1 * * * ?

报错:

nested exception is java.lang.IllegalStateException: Encountered invalid @Scheduled method ‘timeTask’: For input string: “”

2.正确书写

timer:
  test-sync-time-task: 0 0/1 * * * ?

你可能感兴趣的:(Spring,Boot)