fuliqi
2024-07-11 83024eccacc54be0e60eee14d19d03bf9d63ba78
src/main/java/com/ycl/jxkg/job/StudyRecordJob.java
@@ -38,8 +38,8 @@
        log.info("开始存学习时长");
        List<StudyRecord> cacheList = new ArrayList<>();
        // 取出所有学习记录缓存项
        ConcurrentMap<String, Object> map = caffeineCache.asMap();
        Map<String,StudyRecord> studyMap = (Map<String, StudyRecord>) map.get(CaffeineConstant.STUDY_RECORD);
        Map<String, StudyRecord> studyMap = (Map<String, StudyRecord>) caffeineCache.getIfPresent(CaffeineConstant.STUDY_RECORD);
        if (!CollectionUtils.isEmpty(studyMap)) {
        for (Map.Entry<String, StudyRecord> entry : studyMap.entrySet()) {
            cacheList.add(entry.getValue());
        }
@@ -62,6 +62,7 @@
            studyRecordService.saveOrUpdateBatch(cacheList);
        }
        caffeineCache.invalidate(CaffeineConstant.STUDY_RECORD);
        }
        log.info("结束存学习时长");
    }
}