🔨 优化缓存删除逻辑.
This commit is contained in:
@@ -110,7 +110,7 @@ public class HostIdentityServiceImpl implements HostIdentityService {
|
||||
int effect = hostIdentityDAO.insert(record);
|
||||
log.info("HostIdentityService-createHostIdentity effect: {}", effect);
|
||||
// 删除缓存
|
||||
RedisMaps.delete(HostCacheKeyDefine.HOST_IDENTITY);
|
||||
RedisUtils.delete(HostCacheKeyDefine.HOST_IDENTITY);
|
||||
return record.getId();
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ public class HostIdentityServiceImpl implements HostIdentityService {
|
||||
int effect = hostIdentityDAO.update(updateRecord, wrapper);
|
||||
log.info("HostIdentityService-updateHostIdentityById effect: {}", effect);
|
||||
// 删除缓存
|
||||
RedisMaps.delete(HostCacheKeyDefine.HOST_IDENTITY);
|
||||
RedisUtils.delete(HostCacheKeyDefine.HOST_IDENTITY);
|
||||
return effect;
|
||||
}
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ public class HostKeyServiceImpl implements HostKeyService {
|
||||
log.info("HostKeyService-createHostKey effect: {}", effect);
|
||||
Long id = record.getId();
|
||||
// 删除缓存
|
||||
RedisMaps.delete(HostCacheKeyDefine.HOST_KEY);
|
||||
RedisUtils.delete(HostCacheKeyDefine.HOST_KEY);
|
||||
return id;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public class HostKeyServiceImpl implements HostKeyService {
|
||||
int effect = hostKeyDAO.updateById(updateRecord);
|
||||
// 删除缓存
|
||||
if (!record.getName().equals(updateRecord.getName())) {
|
||||
RedisMaps.delete(HostCacheKeyDefine.HOST_KEY);
|
||||
RedisUtils.delete(HostCacheKeyDefine.HOST_KEY);
|
||||
}
|
||||
log.info("HostKeyService-updateHostKeyById effect: {}", effect);
|
||||
return effect;
|
||||
|
||||
@@ -39,6 +39,7 @@ import org.dromara.visor.common.utils.Assert;
|
||||
import org.dromara.visor.framework.biz.operator.log.core.utils.OperatorLogs;
|
||||
import org.dromara.visor.framework.mybatis.core.query.DataQuery;
|
||||
import org.dromara.visor.framework.redis.core.utils.RedisMaps;
|
||||
import org.dromara.visor.framework.redis.core.utils.RedisUtils;
|
||||
import org.dromara.visor.framework.redis.core.utils.barrier.CacheBarriers;
|
||||
import org.dromara.visor.module.asset.convert.HostConvert;
|
||||
import org.dromara.visor.module.asset.dao.HostConfigDAO;
|
||||
@@ -376,7 +377,7 @@ public class HostServiceImpl implements HostService {
|
||||
|
||||
@Override
|
||||
public void clearCache() {
|
||||
RedisMaps.scanKeysDelete(HostCacheKeyDefine.HOST_INFO.format("*"));
|
||||
RedisUtils.scanKeysDelete(HostCacheKeyDefine.HOST_INFO.format("*"));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user