Skip to content

Commit

Permalink
Make metrics happy
Browse files Browse the repository at this point in the history
  • Loading branch information
macobo committed May 13, 2022
1 parent 7c711e7 commit d5e0d05
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions plugin-server/src/worker/ingestion/ingest-event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,6 @@ function shouldSendEventToBuffer(
person: Person | undefined,
teamId: TeamId
): boolean {
if (!hub.CONVERSION_BUFFER_ENABLED && !hub.conversionBufferEnabledTeams.has(teamId)) {
return false
}

const isAnonymousEvent =
event.properties && event.properties['$device_id'] && event.distinctId === event.properties['$device_id']
const isRecentPerson = !person || DateTime.now().diff(person.created_at).seconds < hub.BUFFER_CONVERSION_SECONDS
Expand All @@ -116,5 +112,9 @@ function shouldSendEventToBuffer(
hub.statsd?.increment('conversion_events_buffer_size', { teamId: event.teamId.toString() })
}

if (!hub.CONVERSION_BUFFER_ENABLED && !hub.conversionBufferEnabledTeams.has(teamId)) {
return false
}

return sendToBuffer
}

0 comments on commit d5e0d05

Please sign in to comment.