缓存功能优化, 修改设置后自动修改缓存, 且缓存未完成, 搜索功能暂时禁用.

This commit is contained in:
zhaojun1998
2020-01-02 18:17:11 +08:00
parent 2a367afc37
commit de947e510c
6 changed files with 35 additions and 7 deletions

View File

@@ -11,6 +11,7 @@ import im.zhaojun.common.model.dto.SiteConfigDTO;
import im.zhaojun.common.model.dto.SystemConfigDTO;
import im.zhaojun.common.model.enums.StorageTypeEnum;
import im.zhaojun.common.service.AbstractFileService;
import im.zhaojun.common.service.FileAsyncCacheService;
import im.zhaojun.common.service.StorageConfigService;
import im.zhaojun.common.service.SystemConfigService;
import im.zhaojun.common.service.SystemService;
@@ -44,6 +45,9 @@ public class FileController {
@Resource
private StorageConfigService storageConfigService;
@Resource
private FileAsyncCacheService fileAsyncCacheService;
/**
* 滚动加载每页条数.
*/
@@ -133,6 +137,9 @@ public class FileController {
if (!systemConfigDTO.getSearchEnable()) {
throw new SearchDisableException("搜索功能未开启");
}
if (!fileAsyncCacheService.isCacheFinish()) {
throw new SearchDisableException("搜索功能缓存预热中, 请稍后再试");
}
return ResultBean.success(fileService.search(URLUtil.decode(name)));
}