mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 10:37:41 +08:00
Merge #175
175: Fix update loop infinite loop r=irevoire a=MarinPostma fix update loop infinite loop in case of udpate error. close #169 Co-authored-by: marin postma <postma.marin@protonmail.com>
This commit is contained in:
commit
9f40896f4a
@ -168,9 +168,7 @@ impl<S: IndexStore + Sync + Send> IndexActor<S> {
|
|||||||
None => self.store.create(uuid, None).await?,
|
None => self.store.create(uuid, None).await?,
|
||||||
};
|
};
|
||||||
|
|
||||||
let result =
|
Ok(spawn_blocking(move || update_handler.handle_update(meta, data, index)).await?)
|
||||||
spawn_blocking(move || update_handler.handle_update(meta, data, index)).await?;
|
|
||||||
Ok(result)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn handle_settings(&self, uuid: Uuid) -> IndexResult<Settings<Checked>> {
|
async fn handle_settings(&self, uuid: Uuid) -> IndexResult<Settings<Checked>> {
|
||||||
|
@ -303,9 +303,13 @@ impl UpdateStore {
|
|||||||
}
|
}
|
||||||
None => None,
|
None => None,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Process the pending update using the provided user function.
|
// Process the pending update using the provided user function.
|
||||||
let result = Handle::current()
|
let handle = Handle::current();
|
||||||
.block_on(index_handle.update(index_uuid, processing, file))?;
|
let result = match handle.block_on(index_handle.update(index_uuid, processing.clone(), file)) {
|
||||||
|
Ok(result) => result,
|
||||||
|
Err(e) => Err(processing.fail(e.to_string())),
|
||||||
|
};
|
||||||
|
|
||||||
// Once the pending update have been successfully processed
|
// Once the pending update have been successfully processed
|
||||||
// we must remove the content from the pending and processing stores and
|
// we must remove the content from the pending and processing stores and
|
||||||
|
Loading…
Reference in New Issue
Block a user