From: Ilho Kim Date: Thu, 11 Mar 2021 02:19:46 +0000 (+0900) Subject: Avoid setting duplicate db path X-Git-Tag: submit/tizen/20210317.082331~40 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c442c4ee80ff33ee2e880de7a57e20da97c485d;p=platform%2Fcore%2Fappfw%2Fpkgmgr-info.git Avoid setting duplicate db path Signed-off-by: Ilho Kim --- diff --git a/src/common/database/db_handle_provider.cc b/src/common/database/db_handle_provider.cc index 225c7238..a1a27f61 100644 --- a/src/common/database/db_handle_provider.cc +++ b/src/common/database/db_handle_provider.cc @@ -106,13 +106,17 @@ std::vector DBHandleProvider::GetParserDBPath(pid_t pid) { if (is_memory_ && pid_list_.find(pid) == pid_list_.end()) { db_path_list.emplace_back(parser_memory_db_path_); - db_path_list.emplace_back(global_parser_memory_db_path_); + if (parser_memory_db_path_ != global_parser_memory_db_path_) + db_path_list.emplace_back(global_parser_memory_db_path_); } else { db_path_list.emplace_back(parser_file_db_path_); - db_path_list.emplace_back(global_parser_file_db_path_); + if (parser_file_db_path_ != global_parser_file_db_path_) + db_path_list.emplace_back(global_parser_file_db_path_); } LOGD("local db path : %s", db_path_list[0].c_str()); - LOGD("global db path : %s", db_path_list[1].c_str()); + if (db_path_list.size() == 2) + LOGD("global db path : %s", db_path_list[1].c_str()); + return db_path_list; }