Merge pull request #486 from hxy1991/Fixes#439

[ISSUE #439] save snapshot error
This commit is contained in:
Keep 2018-12-20 16:44:38 +08:00 committed by GitHub
commit ce32594339
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -104,10 +104,14 @@ public class LocalConfigInfoProcessor {
}
} else {
try {
boolean isMdOk = file.getParentFile().mkdirs();
if (!isMdOk) {
log.error(envName, "NACOS-XXXX", "save snapshot error");
File parentFile = file.getParentFile();
if (!parentFile.exists()) {
boolean isMdOk = parentFile.mkdirs();
if (!isMdOk) {
log.error(envName, "NACOS-XXXX", "save snapshot error");
}
}
if (JVMUtil.isMultiInstance()) {
ConcurrentDiskUtil.writeFileContent(file, config,
Constants.ENCODE);