fix a bug on the batch documents function

This commit is contained in:
Tamo 2021-10-27 14:14:05 +02:00 committed by marin postma
parent ddab9eafa1
commit 31c7a0105b
No known key found for this signature in database
GPG Key ID: 6088B7721C3E39F9

View File

@ -338,6 +338,7 @@ mod segment {
lock.primary_keys.insert(primary_key); lock.primary_keys.insert(primary_key);
} }
lock.index_creation |= index_creation; lock.index_creation |= index_creation;
lock.updated = true;
// drop the lock here // drop the lock here
}); });
} }
@ -522,7 +523,7 @@ mod segment {
impl DocumentsBatcher { impl DocumentsBatcher {
pub fn into_event(self, user: &User, event_name: &str) -> Option<Track> { pub fn into_event(self, user: &User, event_name: &str) -> Option<Track> {
if self.updated { if !self.updated {
None None
} else { } else {
let context = Some(json!({ "user-agent": self.user_agents})); let context = Some(json!({ "user-agent": self.user_agents}));