mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-29 16:24:26 +01:00
Apply suggested changes from PR review
This commit is contained in:
parent
441417447e
commit
fbd2be2ec8
@ -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()));
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user