explicitely drop the search permit

This commit is contained in:
Tamo 2024-08-28 14:29:25 +02:00
parent 42e7499260
commit 92b151607c
5 changed files with 36 additions and 4 deletions

View file

@ -39,7 +39,7 @@ pub async fn multi_search_with_post(
) -> Result<HttpResponse, ResponseError> {
// Since we don't want to process half of the search requests and then get a permit refused
// we're going to get one permit for the whole duration of the multi-search request.
let _permit = search_queue.try_get_search_permit().await?;
let permit = search_queue.try_get_search_permit().await?;
let federated_search = params.into_inner();
@ -162,6 +162,7 @@ pub async fn multi_search_with_post(
HttpResponse::Ok().json(SearchResults { results: search_results })
}
};
permit.drop().await;
Ok(response)
}