fix: minor changes

This commit is contained in:
Ankit Nayan 2023-01-07 02:21:44 +05:30
parent 1fd819b806
commit 16a49a8b04
3 changed files with 7 additions and 5 deletions

View File

@ -315,11 +315,11 @@ func (s *Server) analyticsMiddleware(next http.Handler) http.Handler {
}
}
if telemetry.GetInstance().IsSampled() {
// if telemetry.GetInstance().IsSampled() {
if _, ok := telemetry.IgnoredPaths()[path]; !ok {
telemetry.GetInstance().SendEvent(telemetry.TELEMETRY_EVENT_PATH, data)
}
}
// }
})
}

View File

@ -164,6 +164,8 @@ func (mds *ModelDaoSqlite) EditOrg(ctx context.Context, org *model.Organization)
}
telemetry.GetInstance().SetTelemetryAnonymous(org.IsAnonymous)
telemetry.GetInstance().SetDistinctId(org.Id)
return nil
}

View File

@ -228,10 +228,10 @@ func getOutboundIP() string {
}
func (a *Telemetry) IdentifyUser(user *model.User) {
a.SetCompanyDomain(user.Email)
if !a.isTelemetryEnabled() || a.isTelemetryAnonymous() {
return
}
a.SetCompanyDomain(user.Email)
a.operator.Enqueue(analytics.Identify{
UserId: a.ipAddress,