From fbd2be2ec816b8c654c270d3ce67b61c15cd76a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Lecrenier?= Date: Sat, 15 Oct 2022 11:03:24 +0200 Subject: [PATCH] Apply suggested changes from PR review --- index-scheduler/src/batch.rs | 2 +- meilisearch-http/src/routes/tasks.rs | 5 +---- meilisearch-types/src/keys.rs | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/index-scheduler/src/batch.rs b/index-scheduler/src/batch.rs index be24e8467..7e7ec8772 100644 --- a/index-scheduler/src/batch.rs +++ b/index-scheduler/src/batch.rs @@ -840,7 +840,7 @@ impl IndexScheduler { let mut affected_kinds = HashSet::new(); for task_id in to_delete_tasks.iter() { - if let Some(task) = self.all_tasks.get(wtxn, &BEU32::new(task_id))? { + if let Some(task) = self.get_task(wtxn, task_id)? { if let Some(task_indexes) = task.indexes() { affected_indexes.extend(task_indexes.into_iter().map(|x| x.to_owned())); } diff --git a/meilisearch-http/src/routes/tasks.rs b/meilisearch-http/src/routes/tasks.rs index a222604a5..5b63ed7c5 100644 --- a/meilisearch-http/src/routes/tasks.rs +++ b/meilisearch-http/src/routes/tasks.rs @@ -1,6 +1,5 @@ use actix_web::web::Data; use actix_web::{web, HttpRequest, HttpResponse}; -use env_logger::filter; use index_scheduler::{IndexScheduler, Query, TaskId}; use meilisearch_types::error::ResponseError; use meilisearch_types::index_uid::IndexUid; @@ -188,8 +187,6 @@ pub struct TaskDeletionQuery { async fn delete_tasks( index_scheduler: GuardedData, Data>, params: web::Query, - _req: HttpRequest, - _analytics: web::Data, ) -> Result { let TaskDeletionQuery { type_, @@ -221,7 +218,7 @@ async fn delete_tasks( query: filtered_query_string, tasks, }; - // TODO: Lo: analytics + let task = index_scheduler.register(task_deletion)?; let task_view = TaskView::from_task(&task); diff --git a/meilisearch-types/src/keys.rs b/meilisearch-types/src/keys.rs index cbe888ce2..c2773b548 100644 --- a/meilisearch-types/src/keys.rs +++ b/meilisearch-types/src/keys.rs @@ -224,7 +224,7 @@ pub enum Action { IndexesDelete, #[serde(rename = "tasks.*")] TasksAll, - #[serde(rename = "tasks.*")] + #[serde(rename = "tasks.delete")] TasksDelete, #[serde(rename = "tasks.get")] TasksGet,