mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-01-22 19:13:10 +08:00
Handle empty payloads
This commit is contained in:
parent
289eb92bef
commit
11458eefd9
@ -2016,10 +2016,7 @@ impl<'a> Dump<'a> {
|
||||
task: TaskDump,
|
||||
content_file: Option<Box<UpdateFile>>,
|
||||
) -> Result<Task> {
|
||||
let task_has_no_docs = match task.kind {
|
||||
KindDump::DocumentImport { documents_count, .. } if documents_count == 0 => true,
|
||||
_ => false,
|
||||
};
|
||||
let task_has_no_docs = matches!(task.kind, KindDump::DocumentImport { documents_count, .. } if documents_count == 0);
|
||||
|
||||
let content_uuid = match content_file {
|
||||
Some(content_file) if task.status == Status::Enqueued => {
|
||||
@ -2040,9 +2037,7 @@ impl<'a> Dump<'a> {
|
||||
// in case we try to open it later.
|
||||
_ if task.status != Status::Enqueued => Some(Uuid::nil()),
|
||||
None if task.status == Status::Enqueued && task_has_no_docs => {
|
||||
let (uuid, mut file) = self.index_scheduler.create_update_file(false)?;
|
||||
let builder = DocumentsBatchBuilder::new(&mut file);
|
||||
builder.into_inner()?;
|
||||
let (uuid, file) = self.index_scheduler.create_update_file(false)?;
|
||||
file.persist()?;
|
||||
|
||||
Some(uuid)
|
||||
|
Loading…
x
Reference in New Issue
Block a user