Apply suggested changes from PR review

This commit is contained in:
Loïc Lecrenier 2022-10-15 11:03:24 +02:00 committed by Clément Renault
parent 441417447e
commit fbd2be2ec8
No known key found for this signature in database
GPG Key ID: 92ADA4E935E71FA4
3 changed files with 3 additions and 6 deletions

View File

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

View File

@ -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<ActionPolicy<{ actions::TASKS_DELETE }>, Data<IndexScheduler>>,
params: web::Query<TaskDeletionQuery>,
_req: HttpRequest,
_analytics: web::Data<dyn Analytics>,
) -> Result<HttpResponse, ResponseError> {
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);

View File

@ -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,