mirror of
https://gitee.com/openharmony/distributeddatamgr_datamgr_service
synced 2024-11-27 00:51:12 +00:00
commit
db0ab44969
@ -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;
|
||||
|
@ -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_;
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user