cmd/stcrashreceiver: Enable (rough) affected users count (#6511)

Seeing thousands of reports is no use when we don't know if they
represent one poor user or thousands.
This commit is contained in:
Jakob Borg
2020-04-07 13:19:49 +02:00
committed by GitHub
parent df318ed370
commit 4b17c511f9
2 changed files with 29 additions and 2 deletions
+3 -1
View File
@@ -31,12 +31,14 @@ var (
clientsMut sync.Mutex
)
func sendReport(dsn, path string, report []byte) error {
func sendReport(dsn, path string, report []byte, userID string) error {
pkt, err := parseReport(path, report)
if err != nil {
return err
}
pkt.Interfaces = append(pkt.Interfaces, &raven.User{ID: userID})
clientsMut.Lock()
defer clientsMut.Unlock()