Skip to content

Commit

Permalink
chore(analytics): Add UserID field to MetricsInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
ilmotta committed Mar 4, 2025
1 parent 6219faa commit 2d4ba44
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions centralizedmetrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ import (
const defaultPollInterval = 10 * time.Second

type MetricsInfo struct {
Enabled bool `json:"enabled"`
UserConfirmed bool `json:"userConfirmed"`
Enabled bool `json:"enabled"`
UserConfirmed bool `json:"userConfirmed"`
UserID string `json:"userID"`
}

type MetricRepository interface {
Expand Down
2 changes: 1 addition & 1 deletion centralizedmetrics/sqlite_persistence.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func (r *SQLiteMetricRepository) ToggleEnabled(enabled bool) error {

func (r *SQLiteMetricRepository) Info() (*MetricsInfo, error) {
info := MetricsInfo{}
err := r.db.QueryRow("SELECT enabled,user_confirmed FROM centralizedmetrics_uuid LIMIT 1").Scan(&info.Enabled, &info.UserConfirmed)
err := r.db.QueryRow("SELECT enabled,user_confirmed,uuid FROM centralizedmetrics_uuid LIMIT 1").Scan(&info.Enabled, &info.UserConfirmed, &info.UserID)
if err == sql.ErrNoRows {
return &info, nil
}
Expand Down

0 comments on commit 2d4ba44

Please sign in to comment.