mirror of
https://github.com/zfile-dev/zfile.git
synced 2025-04-19 05:34:52 +00:00
🐛 修复切换缓存时, 出现的异常 BUG
This commit is contained in:
@@ -7,6 +7,7 @@ import im.zhaojun.common.model.dto.ResultBean;
|
||||
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 org.springframework.stereotype.Controller;
|
||||
@@ -36,6 +37,9 @@ public class InstallController {
|
||||
@Resource
|
||||
private AdminController adminController;
|
||||
|
||||
@Resource
|
||||
private FileAsyncCacheService fileAsyncCacheService;
|
||||
|
||||
@GetMapping("/is-installed")
|
||||
@ResponseBody
|
||||
public ResultBean isInstall() {
|
||||
@@ -92,6 +96,10 @@ public class InstallController {
|
||||
if (Objects.equals(storageStrategy, currentStorageStrategy)) {
|
||||
AbstractFileService fileService = systemConfigService.getCurrentFileService();
|
||||
fileService.clearCache();
|
||||
|
||||
if (systemConfigService.getEnableCache()) {
|
||||
fileAsyncCacheService.cacheGlobalFile();
|
||||
}
|
||||
fileService.init();
|
||||
}
|
||||
|
||||
|
||||
@@ -164,6 +164,7 @@ public abstract class AbstractFileService implements FileService {
|
||||
return null;
|
||||
}).collect(Collectors.toSet());
|
||||
collect.remove(null);
|
||||
collect.add("/");
|
||||
return collect;
|
||||
} else {
|
||||
return Collections.emptySet();
|
||||
|
||||
Reference in New Issue
Block a user