From c20a1adbbd94b08d7f9c94f5b5a9f0559640e695 Mon Sep 17 00:00:00 2001 From: zuojiangjiang Date: Fri, 1 Apr 2022 11:29:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=86=85=E5=AD=98=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E7=94=9F=E6=95=88=20Signed-off-by:=20zuojiangjiang=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- interfaces/innerkits/distributeddata/include/types.h | 2 +- services/distributeddataservice/app/src/kvstore_app_manager.cpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/interfaces/innerkits/distributeddata/include/types.h b/interfaces/innerkits/distributeddata/include/types.h index e0db34c2b..5047c2670 100644 --- a/interfaces/innerkits/distributeddata/include/types.h +++ b/interfaces/innerkits/distributeddata/include/types.h @@ -207,7 +207,7 @@ enum class DeviceFilterStrategy { struct Options { bool createIfMissing = true; bool encrypt = false; - bool persistent = false; + bool persistent = true; bool backup = true; bool autoSync = true; int securityLevel = SecurityLevel::NO_LABEL; diff --git a/services/distributeddataservice/app/src/kvstore_app_manager.cpp b/services/distributeddataservice/app/src/kvstore_app_manager.cpp index c8c9af74d..35ae7d000 100644 --- a/services/distributeddataservice/app/src/kvstore_app_manager.cpp +++ b/services/distributeddataservice/app/src/kvstore_app_manager.cpp @@ -394,6 +394,7 @@ Status KvStoreAppManager::InitNbDbOption(const Options &options, const std::vect dbOption.syncDualTupleMode = true; // tuple of (appid+storeid) dbOption.createIfNecessary = options.createIfMissing; + dbOption.isMemoryDb = (!options.persistent); dbOption.isEncryptedDb = options.encrypt; if (options.encrypt) { dbOption.cipher = DistributedDB::CipherType::AES_256_GCM; -- Gitee