mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-14 08:58:59 +01:00
Do not send empty edit document by function
This commit is contained in:
parent
995394a516
commit
466604725e
@ -1572,6 +1572,10 @@ impl EditDocumentsByFunctionAggregator {
|
|||||||
pub fn into_event(self, user: &User, event_name: &str) -> Option<Track> {
|
pub fn into_event(self, user: &User, event_name: &str) -> Option<Track> {
|
||||||
let Self { timestamp, user_agents, index_creation, filtered, with_context } = self;
|
let Self { timestamp, user_agents, index_creation, filtered, with_context } = self;
|
||||||
|
|
||||||
|
// if we had no timestamp it means we never encountered any events and
|
||||||
|
// thus we don't need to send this event.
|
||||||
|
let timestamp = timestamp?;
|
||||||
|
|
||||||
let properties = json!({
|
let properties = json!({
|
||||||
"user-agent": user_agents,
|
"user-agent": user_agents,
|
||||||
"filtered": filtered,
|
"filtered": filtered,
|
||||||
@ -1580,7 +1584,7 @@ impl EditDocumentsByFunctionAggregator {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Some(Track {
|
Some(Track {
|
||||||
timestamp,
|
timestamp: Some(timestamp),
|
||||||
user: user.clone(),
|
user: user.clone(),
|
||||||
event: event_name.to_string(),
|
event: event_name.to_string(),
|
||||||
properties,
|
properties,
|
||||||
|
Loading…
Reference in New Issue
Block a user