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:
Tamo 2024-08-28 15:17:10 +02:00
parent 588000d398
commit 3ce8500d4c
4 changed files with 11 additions and 5 deletions

View file

@ -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)
}