用Tasks好象没问题,但我用了楼主的quartz,则不行。
按网上说的,在job上加了注解@DisallowConcurrentExecution也不行
定时时间10秒执行一次
cron.com.huitu.hpda.job.HrJob=0/10 * * * * ?
@IocBean
//必须等上一个执行完才执行下一个注解
@DisallowConcurrentExecution
public class HrJob implements Job {
private Log log = Logs.get();
@Inject
private Dao dao;
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
log.info("hi... "+dao);
readHrData(); //要一分钟
}
}