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

Tweak timeouts.

Kishore Nallan172fc49837c5
diff --git a/include/http_proxy.h b/include/http_proxy.h
index 438fbda0..dee7c015 100644
--- a/include/http_proxy.h
+++ b/include/http_proxy.h
@@ -24,7 +24,7 @@ struct http_proxy_res_t {
class HttpProxy {
// singleton class for http proxy
public:
- static const size_t default_timeout_ms = 30000*4;
+ static const size_t default_timeout_ms = 60000;
static const size_t default_num_try = 2;
static HttpProxy& get_instance() {
diff --git a/src/collection_manager.cpp b/src/collection_manager.cpp
index 39217969..ac740da8 100644
--- a/src/collection_manager.cpp
+++ b/src/collection_manager.cpp
@@ -838,7 +838,7 @@ Option<bool> CollectionManager::do_search(std::map<std::string, std::string>& re
text_match_type_t match_type = max_score;
size_t vector_query_hits = 250;
- size_t remote_embedding_timeout_ms = 30000;
+ size_t remote_embedding_timeout_ms = 5000;
size_t remote_embedding_num_try = 2;
size_t facet_sample_percent = 100;
diff --git a/src/http_client.cpp b/src/http_client.cpp
index 638c9ef7..a1bea098 100644
--- a/src/http_client.cpp
+++ b/src/http_client.cpp
@@ -158,10 +158,8 @@ long HttpClient::perform_curl(CURL *curl, std::map<std::string, std::string>& re
if(res == CURLE_OPERATION_TIMEDOUT) {
double total_time;
- char* http_method;
curl_easy_getinfo(curl, CURLINFO_TOTAL_TIME, &total_time);
- curl_easy_getinfo(curl, CURLINFO_EFFECTIVE_METHOD, http_method);
- LOG(ERROR) << "CURL timeout. Time taken: " << total_time << ", URL: " << http_method << " " << url;
+ LOG(ERROR) << "CURL timeout. Time taken: " << total_time << ", URL: " << url;
status_code = 408;
} else {
LOG(ERROR) << "CURL failed. URL: " << url << ", Code: " << res << ", strerror: " << curl_easy_strerror(res);
diff --git a/src/http_proxy.cpp b/src/http_proxy.cpp
index f3734652..f4fceba2 100644
--- a/src/http_proxy.cpp
+++ b/src/http_proxy.cpp
@@ -68,7 +68,8 @@ http_proxy_res_t HttpProxy::send(const std::string& url, const std::string& meth
break;
}
- LOG(ERROR) << "Proxy call failed, status_code: " << res.status_code << ", num_try: " << num_try;
+ LOG(ERROR) << "Proxy call failed, status_code: " << res.status_code
+ << ", timeout_ms: " << timeout_ms << ", num_try: " << num_try;
}
if(res.status_code == 408){