mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 20:07:09 +02:00
Add some documentation to the index scheduler
This commit is contained in:
parent
66c3b93ef1
commit
169f386418
6 changed files with 180 additions and 64 deletions
|
@ -215,12 +215,12 @@ impl IndexStats {
|
|||
index_uid: String,
|
||||
) -> Result<Self, ResponseError> {
|
||||
// we check if there is currently a task processing associated with this index.
|
||||
let processing_task = index_scheduler.get_tasks(
|
||||
Query::default()
|
||||
.with_status(Status::Processing)
|
||||
.with_index(index_uid.clone())
|
||||
.with_limit(1),
|
||||
)?;
|
||||
let processing_task = index_scheduler.get_tasks(Query {
|
||||
status: Some(vec![Status::Processing]),
|
||||
index_uid: Some(vec![index_uid.clone()]),
|
||||
limit: Some(1),
|
||||
..Query::default()
|
||||
})?;
|
||||
let is_processing = !processing_task.is_empty();
|
||||
|
||||
let index = index_scheduler.index(&index_uid)?;
|
||||
|
|
|
@ -293,11 +293,11 @@ pub fn create_all_stats(
|
|||
let mut last_task: Option<OffsetDateTime> = None;
|
||||
let mut indexes = BTreeMap::new();
|
||||
let mut database_size = 0;
|
||||
let processing_task = index_scheduler.get_tasks(
|
||||
Query::default()
|
||||
.with_status(Status::Processing)
|
||||
.with_limit(1),
|
||||
)?;
|
||||
let processing_task = index_scheduler.get_tasks(Query {
|
||||
status: Some(vec![Status::Processing]),
|
||||
limit: Some(1),
|
||||
..Query::default()
|
||||
})?;
|
||||
let processing_index = processing_task
|
||||
.first()
|
||||
.and_then(|task| task.index_uid().clone());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue