redis频繁批量插入数据 为什么会丢失?
int pageSize = 100;
while (curPage <= totalPage){
int startPos = (curPage - 1) * pageSize;
scoreEntities = misasScoreMapper.doCalculateLastResult(examId, startPos, pageSize);
rank = calculatRankAndTotal(scoreEntities,rank,examId);
curPage++;
// Map<Long, MisasScore> collect1 = scoreEntities.stream().collect(Collectors.toMap(MisasScore::getStudentId, v -> v));
Map<Object, MisasScore> collect = scoreEntities.stream().collect(Collectors.toMap(MisasScore::getStudentId, v -> v));
// redisCache.setCacheMapLong("tmp:"+gradeId,collect);
redisCache.setCacheMap2("tmp:"+gradeId,collect);
// misasScoreMapper.saveLastRanks(scoreEntities);
}