Don't persist read search client across reqs (#5277)
This commit is contained in:
committed by
GitHub
parent
345ada27c0
commit
f81f951814
@@ -14,9 +14,7 @@ use crate::queue::moderation::AutomatedModerationQueue;
|
||||
use crate::queue::session::AuthQueue;
|
||||
use crate::routes::v3::projects::ProjectIds;
|
||||
use crate::routes::{ApiError, v2_reroute, v3};
|
||||
use crate::search::{
|
||||
MeilisearchReadClient, SearchConfig, SearchError, search_for_project,
|
||||
};
|
||||
use crate::search::{SearchConfig, SearchError, search_for_project};
|
||||
use actix_web::{HttpRequest, HttpResponse, delete, get, patch, post, web};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::collections::HashMap;
|
||||
@@ -56,7 +54,6 @@ pub fn config(cfg: &mut web::ServiceConfig) {
|
||||
pub async fn project_search(
|
||||
web::Query(info): web::Query<SearchRequest>,
|
||||
config: web::Data<SearchConfig>,
|
||||
read_client: web::Data<MeilisearchReadClient>,
|
||||
) -> Result<HttpResponse, SearchError> {
|
||||
// Search now uses loader_fields instead of explicit 'client_side' and 'server_side' fields
|
||||
// While the backend for this has changed, it doesnt affect much
|
||||
@@ -102,7 +99,7 @@ pub async fn project_search(
|
||||
..info
|
||||
};
|
||||
|
||||
let results = search_for_project(&info, &config, &read_client).await?;
|
||||
let results = search_for_project(&info, &config).await?;
|
||||
|
||||
let results = LegacySearchResults::from(results);
|
||||
|
||||
|
||||
@@ -28,9 +28,7 @@ use crate::queue::moderation::AutomatedModerationQueue;
|
||||
use crate::queue::session::AuthQueue;
|
||||
use crate::routes::ApiError;
|
||||
use crate::search::indexing::remove_documents;
|
||||
use crate::search::{
|
||||
MeilisearchReadClient, SearchConfig, SearchError, search_for_project,
|
||||
};
|
||||
use crate::search::{SearchConfig, SearchError, search_for_project};
|
||||
use crate::util::img;
|
||||
use crate::util::img::{delete_old_images, upload_image_optimized};
|
||||
use crate::util::routes::read_limited_from_payload;
|
||||
@@ -1039,9 +1037,8 @@ pub async fn edit_project_categories(
|
||||
pub async fn project_search(
|
||||
web::Query(info): web::Query<SearchRequest>,
|
||||
config: web::Data<SearchConfig>,
|
||||
read_client: web::Data<MeilisearchReadClient>,
|
||||
) -> Result<HttpResponse, SearchError> {
|
||||
let results = search_for_project(&info, &config, &read_client).await?;
|
||||
let results = search_for_project(&info, &config).await?;
|
||||
|
||||
// TODO: add this back
|
||||
// let results = ReturnSearchResults {
|
||||
|
||||
Reference in New Issue
Block a user