From 31c7a0105b7089149940d5f26c274d1e207d3245 Mon Sep 17 00:00:00 2001 From: Tamo Date: Wed, 27 Oct 2021 14:14:05 +0200 Subject: [PATCH] fix a bug on the batch documents function --- meilisearch-http/src/analytics.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/meilisearch-http/src/analytics.rs b/meilisearch-http/src/analytics.rs index 776329867..3184602d2 100644 --- a/meilisearch-http/src/analytics.rs +++ b/meilisearch-http/src/analytics.rs @@ -338,6 +338,7 @@ mod segment { lock.primary_keys.insert(primary_key); } lock.index_creation |= index_creation; + lock.updated = true; // drop the lock here }); } @@ -522,7 +523,7 @@ mod segment { impl DocumentsBatcher { pub fn into_event(self, user: &User, event_name: &str) -> Option { - if self.updated { + if !self.updated { None } else { let context = Some(json!({ "user-agent": self.user_agents}));