mirror of
https://github.com/meilisearch/meilisearch.git
synced 2024-11-23 02:27:40 +08:00
use write sender for updates
This commit is contained in:
parent
1640d9ea91
commit
8b99860e85
2
Cargo.lock
generated
2
Cargo.lock
generated
@ -1786,7 +1786,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "meilisearch-http"
|
name = "meilisearch-http"
|
||||||
version = "0.21.0-alpha"
|
version = "0.21.0-alpha.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"actix-cors",
|
"actix-cors",
|
||||||
"actix-http 3.0.0-beta.4",
|
"actix-http 3.0.0-beta.4",
|
||||||
|
@ -280,7 +280,7 @@ impl<S: IndexStore + Sync + Send> IndexActor<S> {
|
|||||||
meta: Processing<UpdateMeta>,
|
meta: Processing<UpdateMeta>,
|
||||||
data: File,
|
data: File,
|
||||||
) -> Result<UpdateResult> {
|
) -> Result<UpdateResult> {
|
||||||
debug!("Processing update {}", meta.id());
|
log::info!("Processing update {}", meta.id());
|
||||||
let uuid = meta.index_uuid();
|
let uuid = meta.index_uuid();
|
||||||
let update_handler = self.update_handler.clone();
|
let update_handler = self.update_handler.clone();
|
||||||
let index = match self.store.get(*uuid).await? {
|
let index = match self.store.get(*uuid).await? {
|
||||||
@ -443,7 +443,7 @@ impl IndexActorHandle {
|
|||||||
) -> anyhow::Result<UpdateResult> {
|
) -> anyhow::Result<UpdateResult> {
|
||||||
let (ret, receiver) = oneshot::channel();
|
let (ret, receiver) = oneshot::channel();
|
||||||
let msg = IndexMsg::Update { ret, meta, data };
|
let msg = IndexMsg::Update { ret, meta, data };
|
||||||
let _ = self.read_sender.send(msg).await;
|
let _ = self.write_sender.send(msg).await;
|
||||||
Ok(receiver.await.expect("IndexActor has been killed")?)
|
Ok(receiver.await.expect("IndexActor has been killed")?)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -500,7 +500,7 @@ impl IndexActorHandle {
|
|||||||
pub async fn delete(&self, uuid: Uuid) -> Result<()> {
|
pub async fn delete(&self, uuid: Uuid) -> Result<()> {
|
||||||
let (ret, receiver) = oneshot::channel();
|
let (ret, receiver) = oneshot::channel();
|
||||||
let msg = IndexMsg::Delete { uuid, ret };
|
let msg = IndexMsg::Delete { uuid, ret };
|
||||||
let _ = self.read_sender.send(msg).await;
|
let _ = self.write_sender.send(msg).await;
|
||||||
Ok(receiver.await.expect("IndexActor has been killed")?)
|
Ok(receiver.await.expect("IndexActor has been killed")?)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,6 @@ async fn get_settings() {
|
|||||||
assert_eq!(settings.keys().len(), 4);
|
assert_eq!(settings.keys().len(), 4);
|
||||||
assert_eq!(settings["displayedAttributes"], json!(["*"]));
|
assert_eq!(settings["displayedAttributes"], json!(["*"]));
|
||||||
assert_eq!(settings["searchableAttributes"], json!(["*"]));
|
assert_eq!(settings["searchableAttributes"], json!(["*"]));
|
||||||
println!("{:?}", settings);
|
|
||||||
assert_eq!(settings["attributesForFaceting"], json!({}));
|
assert_eq!(settings["attributesForFaceting"], json!({}));
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
settings["rankingRules"],
|
settings["rankingRules"],
|
||||||
|
Loading…
Reference in New Issue
Block a user