debug:并发情况下,缓存多存很多信息

This commit is contained in:
磷叶 2025-02-28 09:07:09 +08:00
parent 2f0a51b5c8
commit 130a4a6cbf
3 changed files with 14 additions and 14 deletions

View File

@ -194,12 +194,12 @@ public class AttachClassifyServiceImpl implements AttachClassifyService
@Override
public List<AttachClassifyNameVO> selectAllNameList(){
List<AttachClassifyNameVO> list = redisCache.getCacheList(CacheConstants.ATTACH_CLASSIFY_NAME_LIST);
List<AttachClassifyNameVO> list = redisCache.getCacheObject(CacheConstants.ATTACH_CLASSIFY_NAME_LIST);
if(CollectionUtils.isEmptyElement(list)){
PageHelper.orderBy("bac.sort asc");
list = attachClassifyMapper.selectNameList(new AttachClassifyQuery());
if (CollectionUtils.isNotEmptyElement(list)) {
redisCache.setCacheList(CacheConstants.ATTACH_CLASSIFY_NAME_LIST, list);
redisCache.setCacheObject(CacheConstants.ATTACH_CLASSIFY_NAME_LIST, list);
}
}
return list;

View File

@ -142,11 +142,11 @@ public class ProjectServiceImpl implements ProjectService
@Override
public List<ProjectNameVO> selectAllNameList() {
List<ProjectNameVO> list = redisCache.getCacheList(CacheConstants.PROJECT_NAME_LIST);
List<ProjectNameVO> list = redisCache.getCacheObject(CacheConstants.PROJECT_NAME_LIST);
if (CollectionUtils.isEmptyElement(list)) {
list = projectMapper.selectNameList(new ProjectQuery());
if (CollectionUtils.isNotEmptyElement(list)) {
redisCache.setCacheList(CacheConstants.PROJECT_NAME_LIST, list);
redisCache.setCacheObject(CacheConstants.PROJECT_NAME_LIST, list);
}
}
return list;

View File

@ -722,13 +722,13 @@ public class UserServiceImpl implements UserService
@Override
public List<SysUserNameVO> selectAllUserNameList() {
List<SysUserNameVO> list = redisCache.getCacheList(CacheConstants.USER_NAME_LIST);
List<SysUserNameVO> list = redisCache.getCacheObject(CacheConstants.USER_NAME_LIST);
if (CollectionUtils.isEmptyElement(list)) {
SysUserQuery query = new SysUserQuery();
query.setExcludeUserId(1L);
list = userMapper.selectNameList(query);
if (CollectionUtils.isNotEmptyElement(list)) {
redisCache.setCacheList(CacheConstants.USER_NAME_LIST, list);
redisCache.setCacheObject(CacheConstants.USER_NAME_LIST, list);
}
}
return list;