幸运24-统计-异步改轮询,减少瞬时扫描索引的io压力
This commit is contained in:
@@ -31,8 +31,6 @@ public class Lucky24Task {
|
||||
private PartitionInfoService partitionInfoService;
|
||||
@Autowired
|
||||
private Lucky24RecordService service;
|
||||
@Resource(name = "bizExecutor")
|
||||
private ThreadPoolExecutor bizExecutor;
|
||||
|
||||
@Autowired
|
||||
private JedisService jedisService;
|
||||
@@ -82,7 +80,7 @@ public class Lucky24Task {
|
||||
|
||||
String zoneDate = hourAgo.format(DateTimeUtil.dateFormatter);
|
||||
|
||||
bizExecutor.execute(() -> {
|
||||
try {
|
||||
// 获取当天的第一秒
|
||||
ZonedDateTime startOfDay = hourAgo.withHour(0)
|
||||
.withMinute(0)
|
||||
@@ -101,7 +99,9 @@ public class Lucky24Task {
|
||||
Date systemEndTime = DateTimeUtil.converLocalDateTimeToDate(endOfDay.withZoneSameInstant(ZoneId.systemDefault()).toLocalDateTime());
|
||||
|
||||
service.statDate(partitionInfo.getId(), systemStartTime, systemEndTime, zoneIdHour, zoneDate);
|
||||
});
|
||||
} catch (Exception e){
|
||||
log.error("[lucky24Task] exception {}", e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user