|
@@ -61,12 +61,12 @@ public class ScheduleTaskUtil {
|
|
|
//@GetMapping("/down")
|
|
|
public void runTask() throws Exception {
|
|
|
logger.info("执行定时任务开始=>{}", DateUtils.dateTimeNow());
|
|
|
+ long startMill = System.currentTimeMillis();
|
|
|
// 读取缓存
|
|
|
RedisService redis = SpringUtils.getBean(RedisService.class);
|
|
|
String lock = redis.getCacheObject(DOWN_LOCK);
|
|
|
if (StringUtils.isBlank(lock)) {
|
|
|
- //redis.setCacheObject(DOWN_LOCK, VALUE_LOCK);
|
|
|
- redis.setCacheObject(DOWN_LOCK,VALUE_LOCK, (long) 3600 * 12, TimeUnit.SECONDS);
|
|
|
+ redis.setCacheObject(DOWN_LOCK, VALUE_LOCK);
|
|
|
List<CentereventTEventcatalogue> eventcatalogues = centereventTEventcatalogueMapper.getbeforedateDownload();
|
|
|
for (CentereventTEventcatalogue eventcatalogue : eventcatalogues){
|
|
|
String busIndex = "bus_indx_other";// 其他
|
|
@@ -120,7 +120,7 @@ public class ScheduleTaskUtil {
|
|
|
}
|
|
|
}
|
|
|
//redis.deleteObject(DOWN_LOCK);
|
|
|
- //redis.setCacheObject(DOWN_LOCK, (long) 3600 * 12, TimeUnit.SECONDS);
|
|
|
+ redis.setCacheObject(DOWN_LOCK, (System.currentTimeMillis() -startMill) ,(long) 3600 * 12, TimeUnit.SECONDS);
|
|
|
logger.info("执行定时任务结束=====>{}", DateUtils.dateTimeNow());
|
|
|
}
|
|
|
}
|