Avoid setting duplicate db path
authorIlho Kim <ilho159.kim@samsung.com>
Thu, 11 Mar 2021 02:19:46 +0000 (11:19 +0900)
committer김일호/Tizen Platform Lab(SR)/Engineer/삼성전자 <ilho159.kim@samsung.com>
Thu, 11 Mar 2021 06:39:27 +0000 (15:39 +0900)
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
src/common/database/db_handle_provider.cc

index 225c723862c0b1a421693954686840e2f88a6d61..a1a27f61b51f84820a9f93bd328c678dfce01029 100644 (file)
@@ -106,13 +106,17 @@ std::vector<std::string> 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;
 }