相关疑难解决方法(0)

Spring Boot @Scheduled cron

有没有办法在Spring的@Scheduled cron配置中从propertyClass调用getter(甚至变量)?以下内容无法编译:

@Scheduled(cron = propertyClass.getCronProperty()) 要么 @Scheduled(cron = variable)

我想避免直接抓住房产:

@Scheduled(cron = "${cron.scheduling}")
Run Code Online (Sandbox Code Playgroud)

cron spring schedule spring-boot

11
推荐指数
1
解决办法
9925
查看次数

标签 统计

cron ×1

schedule ×1

spring ×1

spring-boot ×1