Merge pull request !2406 from zqz/master
This commit is contained in:
openharmony_ci 2024-11-15 01:54:32 +00:00 committed by Gitee
commit db0ab44969
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 5 additions and 10 deletions

View File

@ -42,7 +42,7 @@ const char* g_backupFiles[] = {
const char* BACKUP_SUFFIX = ".backup";
// If isBackUp is true, remove db backup files. Otherwise remove source db files.
void KvDelegate::RemoveDbFile(bool isBackUp)
void KvDelegate::RemoveDbFile(bool isBackUp) const
{
for (auto &fileName: g_backupFiles) {
std::string dbPath = path_ + "/" + fileName;

View File

@ -46,7 +46,7 @@ private:
bool RestoreIfNeed(int32_t dbStatus);
void Backup();
void Restore();
void RemoveDbFile(bool isBackUp);
void RemoveDbFile(bool isBackUp) const;
bool CopyFile(bool isBackup);
std::recursive_mutex mutex_;
std::string path_;

View File

@ -90,15 +90,10 @@ std::pair<int, RdbStoreConfig> RdbDelegate::GetConfig(const DistributedData::Sto
}
RdbDelegate::RdbDelegate(const DistributedData::StoreMetaData &meta, int version,
bool registerFunction, const std::string &extUriData, const std::string &backup)
bool registerFunction, const std::string &extUri, const std::string &backup)
: tokenId_(meta.tokenId), bundleName_(meta.bundleName), storeName_(meta.storeId),
haMode_(meta.haMode), extUri_(extUri), backup_(backup)
{
tokenId_ = meta.tokenId;
bundleName_ = meta.bundleName;
storeName_ = meta.storeId;
extUri_ = extUriData;
haMode_ = meta.haMode;
backup_ = backup;
auto [err, config] = GetConfig(meta, registerFunction);
if (err != E_OK) {
ZLOGW("Get rdbConfig failed, errCode is %{public}d, dir is %{public}s", err,