提交 fae4b9a4 编写于 作者: RYAN0UP's avatar RYAN0UP

Clear cache when theme uploaded.

上级 001d9f88
......@@ -223,11 +223,11 @@ public class ThemeServiceImpl implements ThemeService {
try {
// Delete the folder
Files.deleteIfExists(Paths.get(themeProperty.getThemePath()));
FileUtil.del(Paths.get(themeProperty.getThemePath()));
// Delete theme cache
cacheStore.delete(THEMES_CACHE_KEY);
} catch (IOException e) {
} catch (Exception e) {
throw new ServiceException("Failed to delete theme folder", e).setErrorData(themeId);
}
}
......@@ -351,6 +351,8 @@ public class ThemeServiceImpl implements ThemeService {
// Delete theme package
FileUtil.del(uploadPath.toFile());
cacheStore.delete(THEMES_CACHE_KEY);
return getProperty(Paths.get(workDir.toString(), originalBasename));
} catch (IOException e) {
log.error("Failed to upload theme to local: " + uploadPath, e);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册