diff --git a/http-ui/public/updates-script.js b/http-ui/public/updates-script.js index 8005c554c..c034c45b8 100644 --- a/http-ui/public/updates-script.js +++ b/http-ui/public/updates-script.js @@ -52,7 +52,16 @@ $(window).on('load', function () { if (status.type == "Progressing") { const id = 'update-' + status.update_id; const content = $(`#${id} .updateStatus.content`); - content.html('progressing... ' + JSON.stringify(status.meta)); + + let html; + let { type, processed_number_of_documents, total_number_of_documents } = status.meta; + if (type === 'DocumentsAddition' && processed_number_of_documents && total_number_of_documents) { + let progress = Math.round(processed_number_of_documents / total_number_of_documents * 100); + html = ``; + } else { + html = ``; + } + content.html(html); } if (status.type == "Processed") { diff --git a/http-ui/src/main.rs b/http-ui/src/main.rs index bfd326837..a72799770 100644 --- a/http-ui/src/main.rs +++ b/http-ui/src/main.rs @@ -69,7 +69,7 @@ pub struct Opt { pub struct IndexerOpt { /// The amount of documents to skip before printing /// a log regarding the indexing advancement. - #[structopt(long, default_value = "1000000")] // 1m + #[structopt(long, default_value = "100000")] // 100k pub log_every_n: usize, /// MTBL max number of chunks in bytes. diff --git a/src/update/update_store.rs b/src/update/update_store.rs index 4723f0b68..de07f1e21 100644 --- a/src/update/update_store.rs +++ b/src/update/update_store.rs @@ -36,6 +36,9 @@ impl UpdateStore { let processed_meta = env.create_database(Some("processed-meta"))?; let (notification_sender, notification_receiver) = crossbeam_channel::bounded(1); + // Send a first notification to trigger the process. + let _ = notification_sender.send(()); + let update_store = Arc::new(UpdateStore { env, pending,