From 7b288b795cb8eaf26ed3ee618eae26786a9874e7 Mon Sep 17 00:00:00 2001 From: zhaojun1998 Date: Fri, 3 Jan 2020 16:24:53 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E6=97=B6,=20=E5=87=BA=E7=8E=B0=E7=9A=84?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=20BUG?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../im/zhaojun/common/controller/InstallController.java | 8 ++++++++ .../im/zhaojun/common/service/AbstractFileService.java | 1 + 2 files changed, 9 insertions(+) diff --git a/src/main/java/im/zhaojun/common/controller/InstallController.java b/src/main/java/im/zhaojun/common/controller/InstallController.java index 073d0be..4cf748a 100644 --- a/src/main/java/im/zhaojun/common/controller/InstallController.java +++ b/src/main/java/im/zhaojun/common/controller/InstallController.java @@ -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(); } diff --git a/src/main/java/im/zhaojun/common/service/AbstractFileService.java b/src/main/java/im/zhaojun/common/service/AbstractFileService.java index 395ce48..4c677ba 100644 --- a/src/main/java/im/zhaojun/common/service/AbstractFileService.java +++ b/src/main/java/im/zhaojun/common/service/AbstractFileService.java @@ -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();