aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/app/reporting.go
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2024-01-09 16:43:36 +0100
committerAleksandr Nogikh <nogikh@google.com>2024-01-09 17:41:39 +0000
commit83b32fe8f20dc1e910866fa110b0d872df283f03 (patch)
treeda309eb71031a3601d2a735fb1c7cc1c2b7ef43e /dashboard/app/reporting.go
parent1a4b2f7d418bcc0e36927cbd2bc225e5d963636b (diff)
dashboard: include repro messages into daily limits
A recent failure (#4412) could have been more constrained if our reproducer emails were included in our daily limits. Let's change that.
Diffstat (limited to 'dashboard/app/reporting.go')
-rw-r--r--dashboard/app/reporting.go16
1 files changed, 7 insertions, 9 deletions
diff --git a/dashboard/app/reporting.go b/dashboard/app/reporting.go
index 8b85702ca..92749f203 100644
--- a/dashboard/app/reporting.go
+++ b/dashboard/app/reporting.go
@@ -136,20 +136,18 @@ func needReport(c context.Context, typ string, state *ReportingState, bug *Bug)
return
}
- // Limit number of reports sent per day,
- // but don't limit sending repros to already reported bugs.
- if bugReporting.Reported.IsZero() && ent.Sent >= reporting.DailyLimit {
+ // Limit number of reports sent per day.
+ if ent.Sent >= reporting.DailyLimit {
status = fmt.Sprintf("%v: out of quota for today", reporting.DisplayTitle)
reporting, bugReporting = nil, nil
return
}
// Ready to be reported.
- if bugReporting.Reported.IsZero() {
- // This update won't be committed, but it is useful as a best effort measure
- // so that we don't overflow the limit in a single poll.
- ent.Sent++
- }
+ // This update won't be committed, but it is useful as a best effort measure
+ // so that we don't overflow the limit in a single poll.
+ ent.Sent++
+
status = fmt.Sprintf("%v: ready to report", reporting.DisplayTitle)
if !bugReporting.Reported.IsZero() {
status += fmt.Sprintf(" (reported%v on %v)",
@@ -1067,9 +1065,9 @@ func incomingCommandCmd(c context.Context, now time.Time, cmd *dashapi.BugUpdate
case dashapi.BugStatusOpen:
bug.Status = BugStatusOpen
bug.Closed = time.Time{}
+ stateEnt.Sent++
if bugReporting.Reported.IsZero() {
bugReporting.Reported = now
- stateEnt.Sent++ // sending repro does not count against the quota
}
if bugReporting.OnHold.IsZero() && cmd.OnHold {
bugReporting.OnHold = now