mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 02:27:40 +08:00
Merge pull request #31 from meilisearch/improve-update-process
Improve update process
This commit is contained in:
commit
c00fc6f8bb
@ -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 = `<progress class="progress" title="${progress}%" value="${progress}" max="100"></progress>`;
|
||||
} else {
|
||||
html = `<progress class="progress" max="100"></progress>`;
|
||||
}
|
||||
content.html(html);
|
||||
}
|
||||
|
||||
if (status.type == "Processed") {
|
||||
|
@ -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.
|
||||
|
@ -36,6 +36,9 @@ impl<M: 'static, N: 'static> UpdateStore<M, N> {
|
||||
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,
|
||||
|
Loading…
Reference in New Issue
Block a user