Skip to content

Commit

Permalink
!73 【轻量级 PR】:避免redis缓存二次读取
Browse files Browse the repository at this point in the history
Merge pull request !73 from yk_ang/master
  • Loading branch information
chopper711 authored and gitee-org committed Dec 13, 2021
2 parents b55f5ab + ff757d2 commit f8b44d9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public Long online() {
Object object = cache.get(CachePrefix.ONLINE_NUM.getPrefix());

if (null != object) {
return (Long) cache.get(CachePrefix.ONLINE_NUM.getPrefix());
return (Long) object;
}
//这里统计的是有效的accessToken ,如果需要数据精确,需要调整accessToken的有效时间,开发人员建议2小时误差较为合适
Long num = Long.valueOf(cache.keys(CachePrefix.ACCESS_TOKEN.getPrefix(UserEnums.MEMBER) + "*").size());
Expand All @@ -83,7 +83,7 @@ public List<MemberDistributionVO> memberDistribution() {
Object object = cache.get(CachePrefix.MEMBER_DISTRIBUTION.getPrefix());

if (null != object) {
return (List<MemberDistributionVO>) cache.get(CachePrefix.MEMBER_DISTRIBUTION.getPrefix());
return (List<MemberDistributionVO>) object;
}
List<MemberDistributionVO> memberDistributionVOS = memberStatisticsService.distribution();

Expand Down

0 comments on commit f8b44d9

Please sign in to comment.