From 31792dcc0f0c83250a626bdd1742f1a0d94ce5f1 Mon Sep 17 00:00:00 2001 From: Waken Date: Fri, 31 May 2024 12:02:42 +0800 Subject: [PATCH] =?UTF-8?q?ServiceController=E5=A2=9E=E5=8A=A0size?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/WebApi.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/WebApi.cpp b/server/WebApi.cpp index be1f7a96..bfd626cc 100755 --- a/server/WebApi.cpp +++ b/server/WebApi.cpp @@ -323,6 +323,11 @@ public: return _map.erase(key); } + size_t size() { + std::lock_guard lck(_mtx); + return _map.size(); + } + Pointer find(const std::string &key) const { std::lock_guard lck(_mtx); auto it = _map.find(key);