mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-22 04:44:26 +01:00
apply review changes
This commit is contained in:
parent
83d1f858c1
commit
ec06879d28
@ -282,7 +282,7 @@ impl IndexScheduler {
|
|||||||
match batch {
|
match batch {
|
||||||
BatchKind::DocumentClear { ids } => Ok(Some(Batch::IndexOperation {
|
BatchKind::DocumentClear { ids } => Ok(Some(Batch::IndexOperation {
|
||||||
op: IndexOperation::DocumentClear {
|
op: IndexOperation::DocumentClear {
|
||||||
tasks: self.get_existing_tasks_with_processing_batch(
|
tasks: self.get_existing_tasks_for_processing_batch(
|
||||||
rtxn,
|
rtxn,
|
||||||
current_batch,
|
current_batch,
|
||||||
ids,
|
ids,
|
||||||
@ -308,7 +308,7 @@ impl IndexScheduler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
BatchKind::DocumentOperation { method, operation_ids, .. } => {
|
BatchKind::DocumentOperation { method, operation_ids, .. } => {
|
||||||
let tasks = self.get_existing_tasks_with_processing_batch(
|
let tasks = self.get_existing_tasks_for_processing_batch(
|
||||||
rtxn,
|
rtxn,
|
||||||
current_batch,
|
current_batch,
|
||||||
operation_ids,
|
operation_ids,
|
||||||
@ -359,7 +359,7 @@ impl IndexScheduler {
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
BatchKind::DocumentDeletion { deletion_ids, includes_by_filter: _ } => {
|
BatchKind::DocumentDeletion { deletion_ids, includes_by_filter: _ } => {
|
||||||
let tasks = self.get_existing_tasks_with_processing_batch(
|
let tasks = self.get_existing_tasks_for_processing_batch(
|
||||||
rtxn,
|
rtxn,
|
||||||
current_batch,
|
current_batch,
|
||||||
deletion_ids,
|
deletion_ids,
|
||||||
@ -371,7 +371,7 @@ impl IndexScheduler {
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
BatchKind::Settings { settings_ids, .. } => {
|
BatchKind::Settings { settings_ids, .. } => {
|
||||||
let tasks = self.get_existing_tasks_with_processing_batch(
|
let tasks = self.get_existing_tasks_for_processing_batch(
|
||||||
rtxn,
|
rtxn,
|
||||||
current_batch,
|
current_batch,
|
||||||
settings_ids,
|
settings_ids,
|
||||||
@ -520,7 +520,7 @@ impl IndexScheduler {
|
|||||||
BatchKind::IndexDeletion { ids } => Ok(Some(Batch::IndexDeletion {
|
BatchKind::IndexDeletion { ids } => Ok(Some(Batch::IndexDeletion {
|
||||||
index_uid,
|
index_uid,
|
||||||
index_has_been_created: must_create_index,
|
index_has_been_created: must_create_index,
|
||||||
tasks: self.get_existing_tasks_with_processing_batch(rtxn, current_batch, ids)?,
|
tasks: self.get_existing_tasks_for_processing_batch(rtxn, current_batch, ids)?,
|
||||||
})),
|
})),
|
||||||
BatchKind::IndexSwap { id } => {
|
BatchKind::IndexSwap { id } => {
|
||||||
let mut task = self.get_task(rtxn, id)?.ok_or(Error::CorruptedTaskQueue)?;
|
let mut task = self.get_task(rtxn, id)?.ok_or(Error::CorruptedTaskQueue)?;
|
||||||
|
@ -211,9 +211,10 @@ impl IndexScheduler {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Convert an iterator to a `Vec` of tasks. The tasks MUST exist or a
|
/// Convert an iterator to a `Vec` of tasks and edit the `ProcessingBatch` to add the given tasks.
|
||||||
/// `CorruptedTaskQueue` error will be throwed.
|
///
|
||||||
pub(crate) fn get_existing_tasks_with_processing_batch(
|
/// The tasks MUST exist, or a `CorruptedTaskQueue` error will be thrown.
|
||||||
|
pub(crate) fn get_existing_tasks_for_processing_batch(
|
||||||
&self,
|
&self,
|
||||||
rtxn: &RoTxn,
|
rtxn: &RoTxn,
|
||||||
processing_batch: &mut ProcessingBatch,
|
processing_batch: &mut ProcessingBatch,
|
||||||
@ -232,7 +233,7 @@ impl IndexScheduler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Convert an iterator to a `Vec` of tasks. The tasks MUST exist or a
|
/// Convert an iterator to a `Vec` of tasks. The tasks MUST exist or a
|
||||||
/// `CorruptedTaskQueue` error will be throwed.
|
/// `CorruptedTaskQueue` error will be thrown.
|
||||||
pub(crate) fn get_existing_tasks(
|
pub(crate) fn get_existing_tasks(
|
||||||
&self,
|
&self,
|
||||||
rtxn: &RoTxn,
|
rtxn: &RoTxn,
|
||||||
@ -247,7 +248,7 @@ impl IndexScheduler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Convert an iterator to a `Vec` of batches. The batches MUST exist or a
|
/// Convert an iterator to a `Vec` of batches. The batches MUST exist or a
|
||||||
/// `CorruptedTaskQueue` error will be throwed.
|
/// `CorruptedTaskQueue` error will be thrown.
|
||||||
pub(crate) fn get_existing_batches(
|
pub(crate) fn get_existing_batches(
|
||||||
&self,
|
&self,
|
||||||
rtxn: &RoTxn,
|
rtxn: &RoTxn,
|
||||||
|
Loading…
Reference in New Issue
Block a user