Merge pull request #44 from meilisearch/fix-fill-buffer-error

fix error message when empty payload
This commit is contained in:
marin 2021-02-17 14:02:39 +01:00 committed by GitHub
commit b723f23f14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 49 deletions

46
Cargo.lock generated
View File

@ -634,7 +634,6 @@ dependencies = [
"atty", "atty",
"bitflags", "bitflags",
"strsim", "strsim",
"term_size",
"textwrap", "textwrap",
"unicode-width", "unicode-width",
"vec_map", "vec_map",
@ -1720,7 +1719,6 @@ version = "0.1.0"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"bstr", "bstr",
"byte-unit",
"byteorder", "byteorder",
"crossbeam-channel", "crossbeam-channel",
"csv", "csv",
@ -1732,13 +1730,11 @@ dependencies = [
"heed", "heed",
"human_format", "human_format",
"itertools 0.9.0", "itertools 0.9.0",
"jemallocator",
"levenshtein_automata", "levenshtein_automata",
"linked-hash-map", "linked-hash-map",
"log", "log",
"meilisearch-tokenizer", "meilisearch-tokenizer",
"memmap", "memmap",
"near-proximity",
"num-traits", "num-traits",
"obkv", "obkv",
"once_cell", "once_cell",
@ -1747,15 +1743,11 @@ dependencies = [
"pest_derive", "pest_derive",
"rayon", "rayon",
"regex", "regex",
"ringtail",
"roaring", "roaring",
"serde", "serde",
"serde_json", "serde_json",
"slice-group-by",
"smallstr", "smallstr",
"smallvec", "smallvec",
"stderrlog",
"structopt",
"tempfile", "tempfile",
"uuid", "uuid",
] ]
@ -1850,14 +1842,6 @@ dependencies = [
"winapi 0.3.9", "winapi 0.3.9",
] ]
[[package]]
name = "near-proximity"
version = "0.1.0"
source = "git+https://github.com/Kerollmops/plane-sweep-proximity?rev=6608205#66082058537f6fe7709adc4690048d62f3c0e9b7"
dependencies = [
"tinyvec",
]
[[package]] [[package]]
name = "net2" name = "net2"
version = "0.2.37" version = "0.2.37"
@ -2435,12 +2419,6 @@ dependencies = [
"winapi 0.3.9", "winapi 0.3.9",
] ]
[[package]]
name = "ringtail"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "21215c1b9d8f7832b433255bd9eea3e2779aa55b21b2f8e13aad62c74749b237"
[[package]] [[package]]
name = "roaring" name = "roaring"
version = "0.6.4" version = "0.6.4"
@ -2737,19 +2715,6 @@ dependencies = [
"version_check", "version_check",
] ]
[[package]]
name = "stderrlog"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b02f316286ae558d83acc93dd81eaba096e746987a7961d4a9ae026842bae67f"
dependencies = [
"atty",
"chrono",
"log",
"termcolor",
"thread_local",
]
[[package]] [[package]]
name = "stdweb" name = "stdweb"
version = "0.4.20" version = "0.4.20"
@ -2897,16 +2862,6 @@ dependencies = [
"winapi 0.3.9", "winapi 0.3.9",
] ]
[[package]]
name = "term_size"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9"
dependencies = [
"libc",
"winapi 0.3.9",
]
[[package]] [[package]]
name = "termcolor" name = "termcolor"
version = "1.1.2" version = "1.1.2"
@ -2922,7 +2877,6 @@ version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
dependencies = [ dependencies = [
"term_size",
"unicode-width", "unicode-width",
] ]

View File

@ -38,7 +38,7 @@ main_error = "0.1.0"
meilisearch-error = { path = "../MeiliSearch/meilisearch-error" } meilisearch-error = { path = "../MeiliSearch/meilisearch-error" }
meilisearch-tokenizer = { git = "https://github.com/meilisearch/Tokenizer.git", branch = "main" } meilisearch-tokenizer = { git = "https://github.com/meilisearch/Tokenizer.git", branch = "main" }
memmap = "0.7.0" memmap = "0.7.0"
milli = { path = "../milli" } milli = { path = "../milli/milli" }
mime = "0.3.16" mime = "0.3.16"
once_cell = "1.5.2" once_cell = "1.5.2"
rand = "0.7.3" rand = "0.7.3"

View File

@ -38,7 +38,6 @@ impl Data {
file.sync_all().await?; file.sync_all().await?;
let file = file.into_std().await; let file = file.into_std().await;
let index_controller = self.index_controller.clone(); let index_controller = self.index_controller.clone();
let update = tokio::task::spawn_blocking(move ||{ let update = tokio::task::spawn_blocking(move ||{
let mmap; let mmap;

View File

@ -88,7 +88,7 @@ impl UpdateHandler {
builder.index_documents_method(method); builder.index_documents_method(method);
let gzipped = true; let gzipped = true;
let reader = if gzipped { let reader = if gzipped && !content.is_empty() {
Box::new(GzDecoder::new(content)) Box::new(GzDecoder::new(content))
} else { } else {
Box::new(content) as Box<dyn io::Read> Box::new(content) as Box<dyn io::Read>