mirror of
https://gitee.com/openharmony/distributeddatamgr_datamgr_service
synced 2024-11-27 17:10:42 +00:00
add ExtcutorPool and modify code
Signed-off-by: renjiecui <cuirenjie@huawei.com>
This commit is contained in:
parent
f20ec7f9b3
commit
8217086302
@ -57,7 +57,8 @@ HWTEST_F(KvStoreDataServiceTest, RegisterClientDeathObserver001, TestSize.Level1
|
||||
KvStoreDataService kvDataService;
|
||||
Bootstrap::GetInstance().LoadComponents();
|
||||
Bootstrap::GetInstance().LoadCheckers();
|
||||
KvStoreMetaManager::GetInstance().InitMetaParameter(std::make_shared<ExecutorPool>(12, 5));
|
||||
KvStoreMetaManager::GetInstance().BindExecutor(std::make_shared<ExecutorPool>(12, 5));
|
||||
KvStoreMetaManager::GetInstance().InitMetaParameter();
|
||||
Status status = kvDataService.RegisterClientDeathObserver(appId, new KvStoreClientDeathObserver());
|
||||
EXPECT_EQ(status, Status::SUCCESS) << "RegisterClientDeathObserver failed";
|
||||
}
|
||||
|
@ -41,7 +41,8 @@ public:
|
||||
Bootstrap::GetInstance().LoadComponents();
|
||||
Bootstrap::GetInstance().LoadDirectory();
|
||||
Bootstrap::GetInstance().LoadCheckers();
|
||||
KvStoreMetaManager::GetInstance().InitMetaParameter(executors);
|
||||
KvStoreMetaManager::GetInstance().BindExecutor(executors);
|
||||
KvStoreMetaManager::GetInstance().InitMetaParameter();
|
||||
KvStoreMetaManager::GetInstance().InitMetaListener();
|
||||
DeviceManagerAdapter::GetInstance().Init(executors);
|
||||
|
||||
|
@ -232,8 +232,10 @@ std::shared_ptr<RdbSyncer> RdbServiceImpl::GetRdbSyncer(const RdbSyncerParam &pa
|
||||
syncer = it->second;
|
||||
if (!param.isEncrypt_ || param.password_.empty()) {
|
||||
executors_->Remove(syncer->GetTimerId(), true);
|
||||
auto timerId = executors_->Schedule(std::chrono::milliseconds(SYNCER_TIMEOUT), [this, syncer] { SyncerTimeout(syncer); });
|
||||
syncer->SetTimerId(timerId );
|
||||
auto timerId = executors_->Schedule(std::chrono::milliseconds(SYNCER_TIMEOUT), [this, syncer] {
|
||||
SyncerTimeout(syncer);
|
||||
});
|
||||
syncer->SetTimerId(timerId);
|
||||
return true;
|
||||
}
|
||||
syncers.erase(storeId);
|
||||
|
Loading…
Reference in New Issue
Block a user