From 8b99860e850e2423a5e54a97af241cfd9280d140 Mon Sep 17 00:00:00 2001 From: mpostma Date: Thu, 18 Mar 2021 08:27:53 +0100 Subject: [PATCH] use write sender for updates --- Cargo.lock | 2 +- meilisearch-http/src/index_controller/index_actor.rs | 6 +++--- meilisearch-http/tests/settings/get_settings.rs | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 141f6906c..dfb58ff89 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1786,7 +1786,7 @@ dependencies = [ [[package]] name = "meilisearch-http" -version = "0.21.0-alpha" +version = "0.21.0-alpha.1" dependencies = [ "actix-cors", "actix-http 3.0.0-beta.4", diff --git a/meilisearch-http/src/index_controller/index_actor.rs b/meilisearch-http/src/index_controller/index_actor.rs index d9ec8fcda..cc6d67528 100644 --- a/meilisearch-http/src/index_controller/index_actor.rs +++ b/meilisearch-http/src/index_controller/index_actor.rs @@ -280,7 +280,7 @@ impl IndexActor { meta: Processing, data: File, ) -> Result { - debug!("Processing update {}", meta.id()); + log::info!("Processing update {}", meta.id()); let uuid = meta.index_uuid(); let update_handler = self.update_handler.clone(); let index = match self.store.get(*uuid).await? { @@ -443,7 +443,7 @@ impl IndexActorHandle { ) -> anyhow::Result { let (ret, receiver) = oneshot::channel(); 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")?) } @@ -500,7 +500,7 @@ impl IndexActorHandle { pub async fn delete(&self, uuid: Uuid) -> Result<()> { let (ret, receiver) = oneshot::channel(); 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")?) } diff --git a/meilisearch-http/tests/settings/get_settings.rs b/meilisearch-http/tests/settings/get_settings.rs index 1cbfdbb1d..b1030aea9 100644 --- a/meilisearch-http/tests/settings/get_settings.rs +++ b/meilisearch-http/tests/settings/get_settings.rs @@ -19,7 +19,6 @@ async fn get_settings() { assert_eq!(settings.keys().len(), 4); assert_eq!(settings["displayedAttributes"], json!(["*"])); assert_eq!(settings["searchableAttributes"], json!(["*"])); - println!("{:?}", settings); assert_eq!(settings["attributesForFaceting"], json!({})); assert_eq!( settings["rankingRules"],