lib/ur: Reset timer when there's nothing to report (#7169)

This commit is contained in:
Simon Frei 2020-11-28 20:09:22 +01:00 committed by GitHub
parent 240ae0c14f
commit cccbb0bd5e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View File

@ -74,6 +74,7 @@ func handleFailureFn(dsn string) func(w http.ResponseWriter, req *http.Request)
}
if len(reports) == 0 {
// Shouldn't happen
log.Printf("Got zero failure reports")
return
}
@ -91,7 +92,9 @@ func handleFailureFn(dsn string) func(w http.ResponseWriter, req *http.Request)
pkt.Fingerprint = []string{r.Description}
if err := sendReport(dsn, pkt, userIDFor(req)); err != nil {
log.Println("Failed to send crash report:", err)
log.Println("Failed to send failure report:", err)
} else {
log.Println("Sent failure report:", r.Description)
}
}
}

View File

@ -130,7 +130,7 @@ func (r *crashReceiver) servePut(reportID, fullPath string, w http.ResponseWrite
return
}
if err := sendReport(r.dsn, pkt, user); err != nil {
log.Println("Failed to send crash report:", err)
log.Println("Failed to send crash report:", err)
}
}()
}

View File

@ -133,6 +133,8 @@ outer:
case <-ctx.Done():
}
}()
} else {
timer.Reset(minDelay)
}
case <-resetTimer:
timer.Reset(minDelay)