From f32e5e8f9ee2cadafad7a1c9d2617c07230ba39c Mon Sep 17 00:00:00 2001 From: zhaojun1998 Date: Fri, 24 Jan 2020 10:46:00 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20=E4=BF=AE=E5=A4=8D=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=AD=98=E5=82=A8=E5=BC=95=E6=93=8E=E6=97=B6,=20=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E6=B8=85=E7=A9=BA=E5=8E=9F=E5=BC=95=E6=93=8E=E7=BC=93?= =?UTF-8?q?=E5=AD=98=E7=9A=84=20BUG.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/im/zhaojun/common/controller/AdminController.java | 5 +++-- .../java/im/zhaojun/common/controller/CacheController.java | 1 - 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/im/zhaojun/common/controller/AdminController.java b/src/main/java/im/zhaojun/common/controller/AdminController.java index d4dc5e7..03f65ea 100644 --- a/src/main/java/im/zhaojun/common/controller/AdminController.java +++ b/src/main/java/im/zhaojun/common/controller/AdminController.java @@ -54,11 +54,12 @@ public class AdminController { */ @PostMapping("/config") public ResultBean updateConfig(SystemConfigDTO systemConfigDTO) throws Exception { - StorageTypeEnum currentStorageStrategy = systemConfigService.getCurrentStorageStrategy(); - + AbstractFileService currentFileService = systemConfigService.getCurrentFileService(); + currentFileService.clearFileCache(); systemConfigDTO.setId(1); systemConfigService.updateSystemConfig(systemConfigDTO); + StorageTypeEnum currentStorageStrategy = currentFileService.getStorageTypeEnum(); if (!Objects.equals(currentStorageStrategy, systemConfigDTO.getStorageStrategy())) { log.info("已将存储策略由 {} 切换为 {}", currentStorageStrategy, systemConfigDTO.getStorageStrategy()); refreshStorageStrategy(); diff --git a/src/main/java/im/zhaojun/common/controller/CacheController.java b/src/main/java/im/zhaojun/common/controller/CacheController.java index 17c59ec..132e986 100644 --- a/src/main/java/im/zhaojun/common/controller/CacheController.java +++ b/src/main/java/im/zhaojun/common/controller/CacheController.java @@ -68,7 +68,6 @@ public class CacheController { public ResultBean clearCache(String key) throws Exception { AbstractFileService fileService = systemConfigService.getCurrentFileService(); fileService.clearFileCache(); - fileAsyncCacheService.resetCacheCount(); return ResultBean.success(); }