mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
登录恢复guava cache同步缓存
This commit is contained in:
+3
-3
@@ -41,7 +41,7 @@ public class OrganFrameworkServiceImpl implements OrganFrameworkService {
|
||||
/**
|
||||
* 针对 {@link #validOrgan(Long)} 的缓存
|
||||
*/
|
||||
private final LoadingCache<Long, CommonResult<Boolean>> validOrganCache = CacheUtils.buildAsyncReloadingCache(
|
||||
private final LoadingCache<Long, CommonResult<Boolean>> validOrganCache = CacheUtils.buildCache(
|
||||
Duration.ofMinutes(1L), // 过期时间 1 分钟
|
||||
new CacheLoader<>() {
|
||||
|
||||
@@ -55,7 +55,7 @@ public class OrganFrameworkServiceImpl implements OrganFrameworkService {
|
||||
/**
|
||||
* 针对 {@link #validDept(Long)} 的缓存
|
||||
*/
|
||||
private final LoadingCache<Long, CommonResult<Boolean>> validOrganDept = CacheUtils.buildAsyncReloadingCache(
|
||||
private final LoadingCache<Long, CommonResult<Boolean>> validOrganDept = CacheUtils.buildCache(
|
||||
Duration.ofMinutes(1L), // 过期时间 1 分钟
|
||||
new CacheLoader<>() {
|
||||
|
||||
@@ -81,6 +81,6 @@ public class OrganFrameworkServiceImpl implements OrganFrameworkService {
|
||||
@Override
|
||||
@SneakyThrows
|
||||
public void validDept(Long id) {
|
||||
deptApi.validateDept(id).checkError();
|
||||
validOrganDept.get(id).checkError();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user