Fix PR comments

This commit is contained in:
many 2021-10-28 15:42:42 +02:00
parent 59636fa688
commit cbaca2b579
No known key found for this signature in database
GPG Key ID: 2CEF23B75189EACA
4 changed files with 5 additions and 5 deletions

2
Cargo.lock generated
View File

@ -1783,7 +1783,7 @@ dependencies = [
[[package]] [[package]]
name = "milli" name = "milli"
version = "0.19.0" version = "0.19.0"
source = "git+https://github.com/meilisearch/milli.git?branch=update-error-format#ed6db196810f78632758fc386f8a7f5f6cd6f357" source = "git+https://github.com/meilisearch/milli.git?branch=update-error-format#9f1e0d2a49447f106277b8a07e0bba65370b47c8"
dependencies = [ dependencies = [
"bimap", "bimap",
"bincode", "bincode",

View File

@ -99,7 +99,7 @@ impl Index<'_> {
pub async fn wait_update_id(&self, update_id: u64) -> Value { pub async fn wait_update_id(&self, update_id: u64) -> Value {
// try 10 times to get status, or panic to not wait forever // try 10 times to get status, or panic to not wait forever
let url = format!("/indexes/{}/updates/{}", self.uid, update_id); let url = format!("/indexes/{}/updates/{}", self.uid, update_id);
for _ in 0..20 { for _ in 0..10 {
let (response, status_code) = self.service.get(&url).await; let (response, status_code) = self.service.get(&url).await;
assert_eq!(status_code, 200, "response: {}", response); assert_eq!(status_code, 200, "response: {}", response);

View File

@ -22,7 +22,7 @@ pub enum IndexResolverError {
#[error("Internal Error: `{0}`")] #[error("Internal Error: `{0}`")]
Internal(Box<dyn std::error::Error + Send + Sync + 'static>), Internal(Box<dyn std::error::Error + Send + Sync + 'static>),
#[error("Internal Error: Index uuid `{0}` is already assigned.")] #[error("Internal Error: Index uuid `{0}` is already assigned.")]
UUIdAlreadyExists(Uuid), UuidAlreadyExists(Uuid),
#[error("{0}")] #[error("{0}")]
Milli(#[from] milli::Error), Milli(#[from] milli::Error),
#[error("`{0}` is not a valid index uid. Index uid can be an integer or a string containing only alphanumeric characters, hyphens (-) and underscores (_).")] #[error("`{0}` is not a valid index uid. Index uid can be an integer or a string containing only alphanumeric characters, hyphens (-) and underscores (_).")]
@ -60,7 +60,7 @@ impl ErrorCode for IndexResolverError {
IndexResolverError::UnexistingIndex(_) => Code::IndexNotFound, IndexResolverError::UnexistingIndex(_) => Code::IndexNotFound,
IndexResolverError::ExistingPrimaryKey => Code::PrimaryKeyAlreadyPresent, IndexResolverError::ExistingPrimaryKey => Code::PrimaryKeyAlreadyPresent,
IndexResolverError::Internal(_) => Code::Internal, IndexResolverError::Internal(_) => Code::Internal,
IndexResolverError::UUIdAlreadyExists(_) => Code::Internal, IndexResolverError::UuidAlreadyExists(_) => Code::Internal,
IndexResolverError::Milli(e) => MilliError(e).error_code(), IndexResolverError::Milli(e) => MilliError(e).error_code(),
IndexResolverError::BadlyFormatted(_) => Code::InvalidIndexUid, IndexResolverError::BadlyFormatted(_) => Code::InvalidIndexUid,
} }

View File

@ -64,7 +64,7 @@ impl IndexStore for MapIndexStore {
} }
let path = self.path.join(format!("{}", uuid)); let path = self.path.join(format!("{}", uuid));
if path.exists() { if path.exists() {
return Err(IndexResolverError::UUIdAlreadyExists(uuid)); return Err(IndexResolverError::UuidAlreadyExists(uuid));
} }
let index_size = self.index_size; let index_size = self.index_size;