Merge branch 'feature/REQ-2699' into 'master'
feat:(REQ-2699) 灰度delete逻辑, See merge request universal/infrastructure/backend/tyr!177
This commit is contained in:
commit
2c90e32499
@ -135,6 +135,8 @@ public class ProductPermissionCacheServiceImpl implements ProductPermissionCache
|
|||||||
.stream()
|
.stream()
|
||||||
.collect(Collectors.toMap(Map.Entry::getKey, e -> JSONObject.toJSONString(e.getValue())));
|
.collect(Collectors.toMap(Map.Entry::getKey, e -> JSONObject.toJSONString(e.getValue())));
|
||||||
|
|
||||||
|
// 存在hash中部分key移除,为了处理快,直接把redisKey删除掉,修改不频繁
|
||||||
|
redisTemplate.delete(redisKey);
|
||||||
RedisClient.HashOps.hPutAll(redisKey, redisValues);
|
RedisClient.HashOps.hPutAll(redisKey, redisValues);
|
||||||
redisTemplate.expire(redisKey, expireInMinutes, TimeUnit.MINUTES);
|
redisTemplate.expire(redisKey, expireInMinutes, TimeUnit.MINUTES);
|
||||||
log.info("succeed to store product permission: redisKey:{} value:{}", redisKey, redisValues);
|
log.info("succeed to store product permission: redisKey:{} value:{}", redisKey, redisValues);
|
||||||
|
|||||||
@ -81,6 +81,8 @@ public class ProductSaasFeatureResourceCacheServiceImpl implements ProductSaasFe
|
|||||||
.stream()
|
.stream()
|
||||||
.collect(Collectors.toMap(Map.Entry::getKey, e -> JSONObject.toJSONString(e.getValue())));
|
.collect(Collectors.toMap(Map.Entry::getKey, e -> JSONObject.toJSONString(e.getValue())));
|
||||||
|
|
||||||
|
// 存在hash中部分key移除,为了处理快,直接把redisKey删除掉,修改不频繁
|
||||||
|
redisTemplate.delete(redisKey);
|
||||||
RedisClient.HashOps.hPutAll(redisKey, redisValues);
|
RedisClient.HashOps.hPutAll(redisKey, redisValues);
|
||||||
redisTemplate.expire(redisKey, expireInMinutes, TimeUnit.MINUTES);
|
redisTemplate.expire(redisKey, expireInMinutes, TimeUnit.MINUTES);
|
||||||
log.info("succeed to store product featureResource: redisKey:{} value:{}", redisKey, redisValues);
|
log.info("succeed to store product featureResource: redisKey:{} value:{}", redisKey, redisValues);
|
||||||
|
|||||||
@ -130,6 +130,8 @@ public class RolePermissionCacheServiceImpl implements RolePermissionCacheServic
|
|||||||
.stream()
|
.stream()
|
||||||
.collect(Collectors.toMap(Map.Entry::getKey, e -> JSONObject.toJSONString(e.getValue())));
|
.collect(Collectors.toMap(Map.Entry::getKey, e -> JSONObject.toJSONString(e.getValue())));
|
||||||
|
|
||||||
|
// 存在hash中部分key移除,为了处理快,直接把redisKey删除掉,修改不频繁
|
||||||
|
redisTemplate.delete(redisKey);
|
||||||
RedisClient.HashOps.hPutAll(redisKey, redisValues);
|
RedisClient.HashOps.hPutAll(redisKey, redisValues);
|
||||||
redisTemplate.expire(redisKey, expireInMinutes, TimeUnit.MINUTES);
|
redisTemplate.expire(redisKey, expireInMinutes, TimeUnit.MINUTES);
|
||||||
log.info("succeed to store role permission: redisKey:{} value:{}", redisKey, redisValues);
|
log.info("succeed to store role permission: redisKey:{} value:{}", redisKey, redisValues);
|
||||||
|
|||||||
@ -82,6 +82,9 @@ public class RoleSaasFeatureResourceCacheServiceImpl implements RoleSaasFeatureR
|
|||||||
.entrySet()
|
.entrySet()
|
||||||
.stream()
|
.stream()
|
||||||
.collect(Collectors.toMap(Map.Entry::getKey, e -> JSONObject.toJSONString(e.getValue())));
|
.collect(Collectors.toMap(Map.Entry::getKey, e -> JSONObject.toJSONString(e.getValue())));
|
||||||
|
|
||||||
|
// 存在hash中部分key移除,为了处理快,直接把redisKey删除掉,修改不频繁
|
||||||
|
redisTemplate.delete(redisKey);
|
||||||
RedisClient.HashOps.hPutAll(redisKey, redisValues);
|
RedisClient.HashOps.hPutAll(redisKey, redisValues);
|
||||||
redisTemplate.expire(redisKey, expireInMinutes, TimeUnit.MINUTES);
|
redisTemplate.expire(redisKey, expireInMinutes, TimeUnit.MINUTES);
|
||||||
log.info("succeed to store role featureResource: redisKey:{} value:{}", redisKey, redisValues);
|
log.info("succeed to store role featureResource: redisKey:{} value:{}", redisKey, redisValues);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user