Skip to content

Commit a48d523

Browse files
committed
refactor(events): remove redundant PostHog enqueue and add debug logging for point grants
1 parent 76a88fe commit a48d523

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

internal/events/points.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -389,12 +389,6 @@ func (d *PointsGranter) GrantFirstPlacePoints(ctx context.Context, userID int, q
389389
return false, err
390390
}
391391

392-
if d.posthogClient != nil {
393-
d.posthogClient.Enqueue(posthog.Capture{
394-
DistinctId: strconv.Itoa(userID),
395-
})
396-
}
397-
398392
return true, nil
399393
}
400394

@@ -424,6 +418,8 @@ func (d *PointsGranter) grantPoint(ctx context.Context, userID int, questionID i
424418
properties.Set("questionID", strconv.Itoa(questionID))
425419
}
426420

421+
slog.Debug("sending event to PostHog", "event_type", GRANT_POINT_EVENT, "user_id", userID)
422+
427423
d.posthogClient.Enqueue(posthog.Capture{
428424
DistinctId: strconv.Itoa(userID),
429425
Event: GRANT_POINT_EVENT,

0 commit comments

Comments
 (0)