mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 02:27:40 +08: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();
|
let mut affected_kinds = HashSet::new();
|
||||||
|
|
||||||
for task_id in to_delete_tasks.iter() {
|
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() {
|
if let Some(task_indexes) = task.indexes() {
|
||||||
affected_indexes.extend(task_indexes.into_iter().map(|x| x.to_owned()));
|
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::Data;
|
||||||
use actix_web::{web, HttpRequest, HttpResponse};
|
use actix_web::{web, HttpRequest, HttpResponse};
|
||||||
use env_logger::filter;
|
|
||||||
use index_scheduler::{IndexScheduler, Query, TaskId};
|
use index_scheduler::{IndexScheduler, Query, TaskId};
|
||||||
use meilisearch_types::error::ResponseError;
|
use meilisearch_types::error::ResponseError;
|
||||||
use meilisearch_types::index_uid::IndexUid;
|
use meilisearch_types::index_uid::IndexUid;
|
||||||
@ -188,8 +187,6 @@ pub struct TaskDeletionQuery {
|
|||||||
async fn delete_tasks(
|
async fn delete_tasks(
|
||||||
index_scheduler: GuardedData<ActionPolicy<{ actions::TASKS_DELETE }>, Data<IndexScheduler>>,
|
index_scheduler: GuardedData<ActionPolicy<{ actions::TASKS_DELETE }>, Data<IndexScheduler>>,
|
||||||
params: web::Query<TaskDeletionQuery>,
|
params: web::Query<TaskDeletionQuery>,
|
||||||
_req: HttpRequest,
|
|
||||||
_analytics: web::Data<dyn Analytics>,
|
|
||||||
) -> Result<HttpResponse, ResponseError> {
|
) -> Result<HttpResponse, ResponseError> {
|
||||||
let TaskDeletionQuery {
|
let TaskDeletionQuery {
|
||||||
type_,
|
type_,
|
||||||
@ -221,7 +218,7 @@ async fn delete_tasks(
|
|||||||
query: filtered_query_string,
|
query: filtered_query_string,
|
||||||
tasks,
|
tasks,
|
||||||
};
|
};
|
||||||
// TODO: Lo: analytics
|
|
||||||
let task = index_scheduler.register(task_deletion)?;
|
let task = index_scheduler.register(task_deletion)?;
|
||||||
|
|
||||||
let task_view = TaskView::from_task(&task);
|
let task_view = TaskView::from_task(&task);
|
||||||
|
@ -224,7 +224,7 @@ pub enum Action {
|
|||||||
IndexesDelete,
|
IndexesDelete,
|
||||||
#[serde(rename = "tasks.*")]
|
#[serde(rename = "tasks.*")]
|
||||||
TasksAll,
|
TasksAll,
|
||||||
#[serde(rename = "tasks.*")]
|
#[serde(rename = "tasks.delete")]
|
||||||
TasksDelete,
|
TasksDelete,
|
||||||
#[serde(rename = "tasks.get")]
|
#[serde(rename = "tasks.get")]
|
||||||
TasksGet,
|
TasksGet,
|
||||||
|
Loading…
Reference in New Issue
Block a user