io.github.dengchen2020.core.properties.SchedulingBuilder Maven / Gradle / Ivy
package io.github.dengchen2020.core.properties;
import org.springframework.boot.context.properties.ConfigurationProperties;
/**
* 定时任务配置
* @author dengchen
* @since 2024/6/7
*/
@ConfigurationProperties("dc.task.scheduling")
public class SchedulingBuilder {
/**
* 是否开启定时任务优化,相同任务上次未执行完,下次任务不执行,避免任务周期过短且任务执行时间过长导致的任务重复执行,集群环境下可自动由另一台服务器接替执行。不同任务互不影响。未开启则参考spring默认配置
*/
private boolean optimize = true;
public boolean isOptimize() {
return optimize;
}
public void setOptimize(boolean optimize) {
this.optimize = optimize;
}
}