mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 03:47:02 +02:00
Progress displayed in logs
This commit is contained in:
parent
c782c09208
commit
bfefaf71c2
3 changed files with 34 additions and 15 deletions
|
@ -39,7 +39,9 @@ use meilisearch_types::milli::vector::parsed_vectors::{
|
|||
};
|
||||
use meilisearch_types::milli::{self, Filter, ThreadPoolNoAbortBuilder};
|
||||
use meilisearch_types::settings::{apply_settings_to_builder, Settings, Unchecked};
|
||||
use meilisearch_types::tasks::{Details, IndexSwap, Kind, KindWithContent, Status, Task};
|
||||
use meilisearch_types::tasks::{
|
||||
Details, IndexSwap, Kind, KindWithContent, Status, Task, TaskProgress,
|
||||
};
|
||||
use meilisearch_types::{compression, Index, VERSION_FILE_NAME};
|
||||
use roaring::RoaringBitmap;
|
||||
use time::macros::format_description;
|
||||
|
@ -1240,7 +1242,21 @@ impl IndexScheduler {
|
|||
secs_since_started_processing_at
|
||||
.store((now - started_processing_at).as_secs(), atomic::Ordering::Relaxed);
|
||||
|
||||
processing_tasks.write().unwrap().update_progress(progress);
|
||||
let TaskProgress {
|
||||
current_step,
|
||||
finished_steps,
|
||||
total_steps,
|
||||
finished_documents,
|
||||
total_documents,
|
||||
} = processing_tasks.write().unwrap().update_progress(progress);
|
||||
|
||||
tracing::info!(
|
||||
current_step,
|
||||
finished_steps,
|
||||
total_steps,
|
||||
finished_documents,
|
||||
total_documents
|
||||
);
|
||||
};
|
||||
|
||||
match operation {
|
||||
|
|
|
@ -182,8 +182,8 @@ impl ProcessingTasks {
|
|||
self.processing = processing;
|
||||
}
|
||||
|
||||
fn update_progress(&mut self, progress: Progress) {
|
||||
self.progress.get_or_insert_with(TaskProgress::default).update(progress);
|
||||
fn update_progress(&mut self, progress: Progress) -> TaskProgress {
|
||||
self.progress.get_or_insert_with(TaskProgress::default).update(progress)
|
||||
}
|
||||
|
||||
/// Set the processing tasks to an empty list
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue