mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 02:27:40 +08:00
Updates can send progress update status
This commit is contained in:
parent
341046c96c
commit
eb92e72e6c
@ -52,7 +52,13 @@ $(window).on('load', function () {
|
||||
if (status.type == "Processing") {
|
||||
const id = 'update-' + status.update_id;
|
||||
const content = $(`#${id} .updateStatus.content`);
|
||||
content.html('processing');
|
||||
content.html('processing...');
|
||||
}
|
||||
|
||||
if (status.type == "Progressing") {
|
||||
const id = 'update-' + status.update_id;
|
||||
const content = $(`#${id} .updateStatus.content`);
|
||||
content.html('progressing...');
|
||||
}
|
||||
|
||||
if (status.type == "Processed") {
|
||||
|
@ -96,6 +96,7 @@ struct UpdatesTemplate<M: Serialize + Send> {
|
||||
enum UpdateStatus<M> {
|
||||
Pending { update_id: u64, meta: M },
|
||||
Processing { update_id: u64, meta: M },
|
||||
Progressing { update_id: u64, meta: M },
|
||||
Processed { update_id: u64, meta: M },
|
||||
}
|
||||
|
||||
@ -132,6 +133,16 @@ pub fn run(opt: Opt) -> anyhow::Result<()> {
|
||||
|
||||
std::thread::sleep(Duration::from_secs(3));
|
||||
|
||||
let progress = UpdateStatus::Progressing { update_id, meta: meta.clone() };
|
||||
let _ = update_status_sender_cloned.send(progress);
|
||||
|
||||
std::thread::sleep(Duration::from_secs(3));
|
||||
|
||||
let progress = UpdateStatus::Progressing { update_id, meta: meta.clone() };
|
||||
let _ = update_status_sender_cloned.send(progress);
|
||||
|
||||
std::thread::sleep(Duration::from_secs(3));
|
||||
|
||||
let processed = UpdateStatus::Processed { update_id, meta: meta.clone() };
|
||||
let _ = update_status_sender_cloned.send(processed);
|
||||
Ok(meta)
|
||||
|
Loading…
Reference in New Issue
Block a user