mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 11:57:07 +02:00
ensure we never early exit when we have a permit and remove the warning when we implicitely drop a permit
This commit is contained in:
parent
588000d398
commit
3ce8500d4c
4 changed files with 11 additions and 5 deletions
|
@ -93,8 +93,9 @@ pub async fn search(
|
|||
locales,
|
||||
)
|
||||
})
|
||||
.await?;
|
||||
.await;
|
||||
permit.drop().await;
|
||||
let search_result = search_result?;
|
||||
|
||||
if let Ok(ref search_result) = search_result {
|
||||
aggregate.succeed(search_result);
|
||||
|
|
|
@ -237,8 +237,9 @@ pub async fn search_with_url_query(
|
|||
let search_result = tokio::task::spawn_blocking(move || {
|
||||
perform_search(&index, query, search_kind, retrieve_vector, index_scheduler.features())
|
||||
})
|
||||
.await?;
|
||||
.await;
|
||||
permit.drop().await;
|
||||
let search_result = search_result?;
|
||||
if let Ok(ref search_result) = search_result {
|
||||
aggregate.succeed(search_result);
|
||||
}
|
||||
|
@ -281,8 +282,9 @@ pub async fn search_with_post(
|
|||
let search_result = tokio::task::spawn_blocking(move || {
|
||||
perform_search(&index, query, search_kind, retrieve_vectors, index_scheduler.features())
|
||||
})
|
||||
.await?;
|
||||
.await;
|
||||
permit.drop().await;
|
||||
let search_result = search_result?;
|
||||
if let Ok(ref search_result) = search_result {
|
||||
aggregate.succeed(search_result);
|
||||
if search_result.degraded {
|
||||
|
|
|
@ -81,6 +81,7 @@ pub async fn multi_search_with_post(
|
|||
perform_federated_search(&index_scheduler, queries, federation, features)
|
||||
})
|
||||
.await;
|
||||
permit.drop().await;
|
||||
|
||||
if let Ok(Ok(_)) = search_result {
|
||||
multi_aggregate.succeed();
|
||||
|
@ -143,6 +144,7 @@ pub async fn multi_search_with_post(
|
|||
Ok(search_results)
|
||||
}
|
||||
.await;
|
||||
permit.drop().await;
|
||||
|
||||
if search_results.is_ok() {
|
||||
multi_aggregate.succeed();
|
||||
|
@ -162,7 +164,6 @@ pub async fn multi_search_with_post(
|
|||
HttpResponse::Ok().json(SearchResults { results: search_results })
|
||||
}
|
||||
};
|
||||
permit.drop().await;
|
||||
|
||||
Ok(response)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue