feat:(REQ-2699) 灰度delete逻辑,

This commit is contained in:
lilong 2024-09-03 09:00:40 +08:00
parent 16cb46db1c
commit 900daa42b9
4 changed files with 9 additions and 0 deletions

View File

@ -135,6 +135,8 @@ public class ProductPermissionCacheServiceImpl implements ProductPermissionCache
.stream()
.collect(Collectors.toMap(Map.Entry::getKey, e -> JSONObject.toJSONString(e.getValue())));
// 存在hash中部分key移除为了处理快直接把redisKey删除掉修改不频繁
redisTemplate.delete(redisKey);
RedisClient.HashOps.hPutAll(redisKey, redisValues);
redisTemplate.expire(redisKey, expireInMinutes, TimeUnit.MINUTES);
log.info("succeed to store product permission: redisKey:{} value:{}", redisKey, redisValues);

View File

@ -81,6 +81,8 @@ public class ProductSaasFeatureResourceCacheServiceImpl implements ProductSaasFe
.stream()
.collect(Collectors.toMap(Map.Entry::getKey, e -> JSONObject.toJSONString(e.getValue())));
// 存在hash中部分key移除为了处理快直接把redisKey删除掉修改不频繁
redisTemplate.delete(redisKey);
RedisClient.HashOps.hPutAll(redisKey, redisValues);
redisTemplate.expire(redisKey, expireInMinutes, TimeUnit.MINUTES);
log.info("succeed to store product featureResource: redisKey:{} value:{}", redisKey, redisValues);

View File

@ -130,6 +130,8 @@ public class RolePermissionCacheServiceImpl implements RolePermissionCacheServic
.stream()
.collect(Collectors.toMap(Map.Entry::getKey, e -> JSONObject.toJSONString(e.getValue())));
// 存在hash中部分key移除为了处理快直接把redisKey删除掉修改不频繁
redisTemplate.delete(redisKey);
RedisClient.HashOps.hPutAll(redisKey, redisValues);
redisTemplate.expire(redisKey, expireInMinutes, TimeUnit.MINUTES);
log.info("succeed to store role permission: redisKey:{} value:{}", redisKey, redisValues);

View File

@ -82,6 +82,9 @@ public class RoleSaasFeatureResourceCacheServiceImpl implements RoleSaasFeatureR
.entrySet()
.stream()
.collect(Collectors.toMap(Map.Entry::getKey, e -> JSONObject.toJSONString(e.getValue())));
// 存在hash中部分key移除为了处理快直接把redisKey删除掉修改不频繁
redisTemplate.delete(redisKey);
RedisClient.HashOps.hPutAll(redisKey, redisValues);
redisTemplate.expire(redisKey, expireInMinutes, TimeUnit.MINUTES);
log.info("succeed to store role featureResource: redisKey:{} value:{}", redisKey, redisValues);