mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-06-07 04:35:37 +00:00
Wait for the batched tasks bu their real uid.
Some of them succeed, others fail. Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
This commit is contained in:
parent
f3d691667d
commit
3e0de6cb83
@ -2924,8 +2924,10 @@ async fn batch_several_documents_addition() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// wait first batch of documents to finish
|
// wait first batch of documents to finish
|
||||||
futures::future::join_all(waiter).await;
|
let finished_tasks = futures::future::join_all(waiter).await;
|
||||||
index.wait_task(4).await.succeeded();
|
for (task, _code) in finished_tasks {
|
||||||
|
index.wait_task(task.uid()).await;
|
||||||
|
}
|
||||||
|
|
||||||
// run a second completely failing batch
|
// run a second completely failing batch
|
||||||
documents[40] = json!({"title": "error", "desc": "error"});
|
documents[40] = json!({"title": "error", "desc": "error"});
|
||||||
@ -2936,8 +2938,10 @@ async fn batch_several_documents_addition() {
|
|||||||
waiter.push(index.add_documents(json!(chunk), Some("id")));
|
waiter.push(index.add_documents(json!(chunk), Some("id")));
|
||||||
}
|
}
|
||||||
// wait second batch of documents to finish
|
// wait second batch of documents to finish
|
||||||
futures::future::join_all(waiter).await;
|
let finished_tasks = futures::future::join_all(waiter).await;
|
||||||
index.wait_task(9).await.failed();
|
for (task, _code) in finished_tasks {
|
||||||
|
index.wait_task(task.uid()).await;
|
||||||
|
}
|
||||||
|
|
||||||
let (response, _code) = index.filtered_tasks(&[], &["failed"], &[]).await;
|
let (response, _code) = index.filtered_tasks(&[], &["failed"], &[]).await;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user