From 03863f7e14f6d610fee32f051083d8605a560cb5 Mon Sep 17 00:00:00 2001 From: zph Date: Sat, 12 Apr 2025 12:02:29 +0800 Subject: [PATCH] update Signed-off-by: zph --- .../distributeddataservice/service/udmf/store/store_cache.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/distributeddataservice/service/udmf/store/store_cache.cpp b/services/distributeddataservice/service/udmf/store/store_cache.cpp index 9bd6ae679..2781004c3 100644 --- a/services/distributeddataservice/service/udmf/store/store_cache.cpp +++ b/services/distributeddataservice/service/udmf/store/store_cache.cpp @@ -60,7 +60,7 @@ std::shared_ptr StoreCache::GetStore(std::string intention) std::unique_lock lock(taskMutex_); if (taskId_ == ExecutorPool::INVALID_TASK_ID && executorPool_ != nullptr) { - taskId_ = executorPool_->Schedule(std::chrono::minutes(INTERVAL), std::bind(&StoreCache::GarbageCollect, this)); + taskId_ = executorPool_->Schedule(std::chrono::minutes(INTERVAL), [this]() { GarbageCollect(); }); } return store; } @@ -78,7 +78,7 @@ void StoreCache::GarbageCollect() std::unique_lock lock(taskMutex_); if (!stores_.Empty() && executorPool_ != nullptr) { ZLOGD("GarbageCollect, stores size:%{public}zu", stores_.Size()); - taskId_ = executorPool_->Schedule(std::chrono::minutes(INTERVAL), std::bind(&StoreCache::GarbageCollect, this)); + taskId_ = executorPool_->Schedule(std::chrono::minutes(INTERVAL), [this]() { GarbageCollect(); }); } else { taskId_ = ExecutorPool::INVALID_TASK_ID; } -- Gitee