feat(statistics): 添加当日数据Redis缓存并调整定时任务时间

- 在AppStatisticsServiceImpl中实现当日数据的Redis缓存机制
- 仅对实时查询且查询日期为当天的数据进行缓存
- 设置缓存时间为60秒以减少实时查询压力
- 将历史数据查询与实时数据查询分离
- 调整ScenicStatsTask定时任务执行时间
- 添加每日凌晨3点执行的任务配置
- 新增每天0点1分执行的统计任务调度
This commit is contained in:
2026-02-05 01:05:56 +08:00
parent 6c330764ea
commit a85d6b0ead
2 changed files with 11 additions and 1 deletions

View File

@@ -60,7 +60,8 @@ public class ScenicStatsTask {
});
}
}
@Scheduled(cron = "0 0 2 * * *")
@Scheduled(cron = "0 0 3 * * *")
@Scheduled(cron = "0 1 0 * * *")
public void countScenicStats() {
log.info("开始执行景区统计任务,统计前7天至昨天的数据");