Skip to content

Open Source alternative to Algolia + Pinecone and an Easier-to-Use alternative to ElasticSearch ⚡ 🔍 ✨ Fast, typo tolerant, in-memory fuzzy Search Engine for building delightful search experiences

Upgrade lock for cache erase.

Kishore Nallan0419a40e6ff9
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<http_req>& req, const std::shared_ptr<http
}
// Result found in cache but ttl has lapsed.
+ lock.unlock();
+ std::unique_lock ulock(mutex);
res_cache.erase(req_hash);
}
}
@@ -456,6 +458,8 @@ bool post_multi_search(const std::shared_ptr<http_req>& 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);
}
}