mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-06-06 12:15:45 +00:00
Wait for the add_documents task
Format the code Signed-off-by: Martin Tzvetanov Grigorov <mgrigorov@apache.org>
This commit is contained in:
parent
46ff78b4ec
commit
4897ad99d0
@ -11,7 +11,8 @@ use regex_lite::Regex;
|
|||||||
static SNAPSHOT_NAMES: Lazy<Mutex<HashMap<PathBuf, usize>>> = Lazy::new(Mutex::default);
|
static SNAPSHOT_NAMES: Lazy<Mutex<HashMap<PathBuf, usize>>> = Lazy::new(Mutex::default);
|
||||||
/// A regex to match UUIDs in messages, specifically looking for the UUID v4 format
|
/// A regex to match UUIDs in messages, specifically looking for the UUID v4 format
|
||||||
static UUID_IN_MESSAGE_RE: Lazy<Regex> = Lazy::new(|| {
|
static UUID_IN_MESSAGE_RE: Lazy<Regex> = Lazy::new(|| {
|
||||||
Regex::new(r"[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}").unwrap()
|
Regex::new(r"[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}")
|
||||||
|
.unwrap()
|
||||||
});
|
});
|
||||||
|
|
||||||
/// Return the md5 hash of the given string
|
/// Return the md5 hash of the given string
|
||||||
@ -250,9 +251,9 @@ macro_rules! json_string {
|
|||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use uuid::Uuid;
|
|
||||||
use crate as meili_snap;
|
use crate as meili_snap;
|
||||||
use crate::UUID_IN_MESSAGE_RE;
|
use crate::UUID_IN_MESSAGE_RE;
|
||||||
|
use uuid::Uuid;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn snap() {
|
fn snap() {
|
||||||
|
@ -130,8 +130,8 @@ async fn search_with_stop_word() {
|
|||||||
snapshot!(code, @"202 Accepted");
|
snapshot!(code, @"202 Accepted");
|
||||||
|
|
||||||
let documents = DOCUMENTS.clone();
|
let documents = DOCUMENTS.clone();
|
||||||
index.add_documents(documents, None).await;
|
let (task, code) = index.add_documents(documents, None).await;
|
||||||
index.wait_task(1).await;
|
index.wait_task(task.uid()).await.succeeded();
|
||||||
|
|
||||||
// prefix search
|
// prefix search
|
||||||
index
|
index
|
||||||
|
Loading…
x
Reference in New Issue
Block a user