From 024f73866a839a630e87e45828562150062c7ceb Mon Sep 17 00:00:00 2001 From: Robert LU Date: Wed, 21 Apr 2021 13:44:24 +0800 Subject: [PATCH] [ISSUE #5429]fix spi (#5429) --- .../alibaba/nacos/client/config/NacosConfigService.java | 1 - .../client/config/impl/LocalEncryptedDataKeyProcessor.java | 7 +++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/client/src/main/java/com/alibaba/nacos/client/config/NacosConfigService.java b/client/src/main/java/com/alibaba/nacos/client/config/NacosConfigService.java index 2ce91908b..42366b1cf 100644 --- a/client/src/main/java/com/alibaba/nacos/client/config/NacosConfigService.java +++ b/client/src/main/java/com/alibaba/nacos/client/config/NacosConfigService.java @@ -160,7 +160,6 @@ public class NacosConfigService implements ConfigService { ConfigResponse response = worker.getServerConfig(dataId, group, tenant, timeoutMs); cr.setContent(response.getContent()); cr.setEncryptedDataKey(response.getEncryptedDataKey()); - configFilterChainManager.doFilter(null, cr); configFilterChainManager.doFilter(null, cr); content = cr.getContent(); diff --git a/client/src/main/java/com/alibaba/nacos/client/config/impl/LocalEncryptedDataKeyProcessor.java b/client/src/main/java/com/alibaba/nacos/client/config/impl/LocalEncryptedDataKeyProcessor.java index 6790b6dde..b79558331 100644 --- a/client/src/main/java/com/alibaba/nacos/client/config/impl/LocalEncryptedDataKeyProcessor.java +++ b/client/src/main/java/com/alibaba/nacos/client/config/impl/LocalEncryptedDataKeyProcessor.java @@ -91,6 +91,13 @@ public class LocalEncryptedDataKeyProcessor extends LocalConfigInfoProcessor { LOGGER.error("[" + envName + "] delete snapshot error, " + file, ioe); } } else { + File parentFile = file.getParentFile(); + if (!parentFile.exists()) { + boolean isMdOk = parentFile.mkdirs(); + if (!isMdOk) { + LOGGER.error("[{}] save snapshot error", envName); + } + } if (JvmUtil.isMultiInstance()) { ConcurrentDiskUtil.writeFileContent(file, encryptDataKey, Constants.ENCODE); } else {