Delay server ready timing until creating cache
[platform/core/appfw/pkgmgr-info.git] / src / server / request_handler / create_cache_request_handler.cc
index 012d746..f70cf2d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+// Copyright (c) 2021 - 2022 Samsung Electronics Co., Ltd All Rights Reserved
 // Use of this source code is governed by an apache-2.0 license that can be
 // found in the LICENSE file.
 
@@ -69,13 +69,12 @@ bool CreateCacheRequestHandler::HandleRequest(const unsigned char* data, int siz
   psd::CacheDBHandler db(GetUID(), GetPID());
   db.SetLocale(locale);
 
-  int ret = db.Execute();
-
-  return ret == PMINFO_R_OK;
+  success_ = (db.Execute() == PMINFO_R_OK);
+  return success_;
 }
 
 std::vector<uint8_t> CreateCacheRequestHandler::ExtractResult() {
-  return {};
+  return { static_cast<uint8_t>(success_) };
 }
 
 void CreateCacheRequestHandler::PreExec() {