From 0419a40e6ff93949137c1cb5ff547ef73e8f9351 Mon Sep 17 00:00:00 2001 From: Kishore Nallan Date: Wed, 24 May 2023 17:30:46 +0530 Subject: [PATCH] Upgrade lock for cache erase. --- src/core_api.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core_api.cpp b/src/core_api.cpp index 3d33ff86..d5d881a2 100644 --- a/src/core_api.cpp +++ b/src/core_api.cpp @@ -362,6 +362,8 @@ bool get_search(const std::shared_ptr& req, const std::shared_ptr& req, const std::shared_p } // Result found in cache but ttl has lapsed. + lock.unlock(); + std::unique_lock ulock(mutex); res_cache.erase(req_hash); } }