Implement ErrorCode on the milli::Error type

This commit is contained in:
Kerollmops 2022-10-04 10:38:17 +02:00 committed by Clément Renault
parent 478e3f0f6b
commit b83710ea98
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
6 changed files with 45 additions and 10 deletions

View file

@ -13,7 +13,6 @@ pub mod metrics;
pub mod route_metrics;
use std::sync::{atomic::AtomicBool, Arc};
use std::time::Duration;
use crate::error::MeilisearchHttpError;
use actix_web::error::JsonPayloadError;
@ -21,7 +20,6 @@ use actix_web::web::Data;
use analytics::Analytics;
use error::PayloadError;
use http::header::CONTENT_TYPE;
use index_scheduler::milli::update::IndexerConfig;
pub use option::Opt;
use actix_web::{web, HttpRequest};
@ -29,7 +27,6 @@ use actix_web::{web, HttpRequest};
use extractors::payload::PayloadConfig;
use index_scheduler::IndexScheduler;
use meilisearch_auth::AuthController;
use sysinfo::{RefreshKind, System, SystemExt};
pub static AUTOBATCHING_ENABLED: AtomicBool = AtomicBool::new(false);

View file

@ -1,9 +1,5 @@
use std::convert::TryFrom;
use std::sync::Arc;
use actix_web::web::Data;
use actix_web::{web, HttpRequest, HttpResponse};
use index::Index;
use index_scheduler::milli::FieldDistribution;
use index_scheduler::{IndexScheduler, KindWithContent, Query, Status};
use log::debug;
@ -74,7 +70,6 @@ pub async fn list_indexes(
) -> Result<HttpResponse, ResponseError> {
let search_rules = &index_scheduler.filters().search_rules;
let indexes: Vec<_> = index_scheduler.indexes()?;
let nb_indexes = indexes.len();
let indexes = indexes
.iter()
.filter(|index| search_rules.is_index_authorized(&index.name))

View file

@ -16,7 +16,7 @@ use meilisearch_types::star_or::StarOr;
use crate::analytics::Analytics;
use crate::extractors::authentication::{policies::*, GuardedData};
use self::indexes::{IndexStats, IndexView};
use self::indexes::IndexStats;
mod api_key;
mod dump;