From dc01706320c7dbb56542f5cd172a67432e8151fd Mon Sep 17 00:00:00 2001 From: wangkailong Date: Fri, 15 Aug 2025 18:17:17 +0800 Subject: [PATCH] clode Signed-off-by: wangkailong --- .../insight_intent_rdb_data_mgr.h | 1 - .../insight_intent_rdb_data_mgr.cpp | 21 ------------------- 2 files changed, 22 deletions(-) diff --git a/services/abilitymgr/include/insight_intent/insight_intent_rdb_data_mgr.h b/services/abilitymgr/include/insight_intent/insight_intent_rdb_data_mgr.h index 62beb6fd4fa..c4bd1e77077 100644 --- a/services/abilitymgr/include/insight_intent/insight_intent_rdb_data_mgr.h +++ b/services/abilitymgr/include/insight_intent/insight_intent_rdb_data_mgr.h @@ -82,7 +82,6 @@ private: int32_t InsertWithRetry(std::shared_ptr rdbStore, int64_t &rowId, const NativeRdb::ValuesBucket &valuesBucket); bool IsRetryErrCode(int32_t errCode); - void DelayCloseRdbStore(); std::shared_ptr rdbStore_; std::mutex rdbStoreMutex_; diff --git a/services/abilitymgr/src/insight_intent/insight_intent_rdb_data_mgr.cpp b/services/abilitymgr/src/insight_intent/insight_intent_rdb_data_mgr.cpp index cd386ab1179..7ebc46b7621 100644 --- a/services/abilitymgr/src/insight_intent/insight_intent_rdb_data_mgr.cpp +++ b/services/abilitymgr/src/insight_intent/insight_intent_rdb_data_mgr.cpp @@ -24,7 +24,6 @@ const std::string INTENT_KEY = "INTENT_KEY"; const std::string INTENT_VALUE = "INTENT_VALUE"; const int32_t INTENT_KEY_INDEX = 0; const int32_t INTENT_VALUE_INDEX = 1; -constexpr int8_t CLOSE_TIME = 20; // delay 20s stop rdbStore constexpr int32_t RETRY_TIMES = 3; constexpr int32_t RETRY_INTERVAL = 500; // 500ms constexpr int16_t WRITE_TIMEOUT = 300; // 300s @@ -73,10 +72,6 @@ std::shared_ptr InsightIntentRdbDataMgr::GetRdbStore() TAG_LOGE(AAFwkTag::INTENT, "rdb restore failed ret:%{public}d", restoreRet); } } - - if (rdbStore_ != nullptr) { - DelayCloseRdbStore(); - } return rdbStore_; } @@ -99,22 +94,6 @@ bool InsightIntentRdbDataMgr::IsIntentRdbLoaded() return true; } -void InsightIntentRdbDataMgr::DelayCloseRdbStore() -{ - std::weak_ptr weakPtr = shared_from_this(); - auto task = [weakPtr]() { - std::this_thread::sleep_for(std::chrono::seconds(CLOSE_TIME)); - auto sharedPtr = weakPtr.lock(); - if (sharedPtr == nullptr) { - return; - } - std::lock_guard lock(sharedPtr->rdbStoreMutex_); - sharedPtr->rdbStore_ = nullptr; - }; - std::thread closeRdbStoreThread(task); - closeRdbStoreThread.detach(); -} - bool InsightIntentRdbDataMgr::InsertData(const std::string &key, const std::string &value) { std::lock_guard lock(rdbStoreMutex_); -- Gitee