diff options
| author | Dmitry Vyukov <dvyukov@google.com> | 2017-08-02 16:22:19 +0200 |
|---|---|---|
| committer | Dmitry Vyukov <dvyukov@google.com> | 2017-08-02 16:37:42 +0200 |
| commit | 44347e87421952fc6038f39e2ef395a2accc414f (patch) | |
| tree | 7cc2b903fe57254c79939e01a0d6318ea658d6c4 | |
| parent | 61d1beb284931d6cc182b60868626f5e2ed819e4 (diff) | |
dashboard/app: purge at most 10 crashes at once
We see some episodic
"failed to delete old crash texts: Call error 11: Deadline exceeded (timeout)"
errors in logs.
Deleting at most 10 bugs should be enough since we do this check
after adding each new crash.
| -rw-r--r-- | dashboard/app/api.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/dashboard/app/api.go b/dashboard/app/api.go index e25767469..094ae5936 100644 --- a/dashboard/app/api.go +++ b/dashboard/app/api.go @@ -424,6 +424,7 @@ func apiReportCrash(c context.Context, ns string, r *http.Request) (interface{}, } func purgeOldCrashes(c context.Context, bug *Bug, bugKey *datastore.Key) { + const batchSize = 10 // delete at most that many at once if bug.NumCrashes <= maxCrashes { return } @@ -434,7 +435,7 @@ func purgeOldCrashes(c context.Context, bug *Bug, bugKey *datastore.Key) { Filter("ReproSyz=", 0). Order("Report"). Order("Time"). - Limit(maxCrashes+100). + Limit(maxCrashes+batchSize). GetAll(c, &crashes) if err != nil { log.Errorf(c, "failed to fetch purge crashes: %v", err) |
