diff --git a/curvefs/src/client/kvclient/kvclient_manager.cpp b/curvefs/src/client/kvclient/kvclient_manager.cpp index 9bd08d2b56..864d2e38bd 100644 --- a/curvefs/src/client/kvclient/kvclient_manager.cpp +++ b/curvefs/src/client/kvclient/kvclient_manager.cpp @@ -62,9 +62,9 @@ void KVClientManager::Uninit() { } void KVClientManager::Set(std::shared_ptr task) { - threadPool_.Enqueue([task, this]() { + kvClientManagerMetric_->setQueueSize << 1; + threadPool_.Enqueue([task, this]() { std::string error_log; - kvClientManagerMetric_->setQueueSize << 1; task->res = client_->Set(task->key, task->value, task->length, &error_log); kvClientManagerMetric_->setQueueSize << -1; @@ -98,10 +98,10 @@ void UpdateHitMissMetric(memcached_return_t retCode, } void KVClientManager::Get(std::shared_ptr task) { - threadPool_.Enqueue([task, this]() { + kvClientManagerMetric_->getQueueSize << 1; + threadPool_.Enqueue([task, this]() { std::string error_log; memcached_return_t retCode; - kvClientManagerMetric_->getQueueSize << 1; task->res = client_->Get(task->key, task->value, task->offset, task->valueLength, &error_log, &task->length, &retCode);