Change the regeration timing after all cache remove 36/303036/2
authorIlho Kim <ilho159.kim@samsung.com>
Tue, 19 Dec 2023 06:31:43 +0000 (15:31 +0900)
committerIlho Kim <ilho159.kim@samsung.com>
Tue, 19 Dec 2023 06:42:43 +0000 (15:42 +0900)
Since the operation of removing all caches is when the language is changed or
db is changed during cache creation, remove the operation of attempting
to create cache for each request and try to create cache again after
a certain period of time after removing all caches

Change-Id: I4b70af215bd68ad5ac97f0ae733bf7063fe3421f
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
src/server/runner.cc

index 2d29a93..7c18adb 100644 (file)
@@ -89,10 +89,6 @@ int Runner::OnReceiveRequest(int fd, GIOCondition cond, void* user_data) {
 
   auto req = std::make_shared<PkgRequest>(client_fd);
 
-  if (CacheFlag::SetPreparing()) {
-    runner->QueueRequest(
-        std::make_shared<CreateCacheRequest>(runner->default_uid_, runner));
-  }
   runner->QueueRequest(std::move(req));
 
   return G_SOURCE_CONTINUE;
@@ -101,6 +97,7 @@ int Runner::OnReceiveRequest(int fd, GIOCondition cond, void* user_data) {
 void Runner::OnChanged(const std::string& locale) {
   thread_pool_->SetLocale(locale);
   QueueRequest(std::make_shared<RemoveAllCacheRequest>(default_uid_));
+  SetCreateCacheTimer();
 }
 
 void Runner::OnDbChanged() {