From 8dad1983a042b0aa555aba347cf9b9fd201591cc Mon Sep 17 00:00:00 2001 From: waken <33921191+mc373906408@users.noreply.github.com> Date: Sat, 1 Jun 2024 18:14:52 +0800 Subject: [PATCH] =?UTF-8?q?ServiceController=E5=A2=9E=E5=8A=A0size?= =?UTF-8?q?=E6=96=B9=E6=B3=95=20(#3587)?= 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);