aboutsummaryrefslogtreecommitdiffstats
path: root/dashboard/app/reporting.go
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2019-03-12 13:23:20 +0100
committerDmitry Vyukov <dvyukov@google.com>2019-03-17 18:06:44 +0100
commit5cf6e34d9e776fa906088beff75fa93b4e3681c2 (patch)
treed4fd1db3af44154a8def02d132c70cb04e9108d3 /dashboard/app/reporting.go
parentd543ef91374057306631c795dbaa19467c509232 (diff)
dashboard/app: add markCrashReported helper
Factor out markCrashReported out of incomingCommandTx. Use it when creating patch testing jobs. Will be needed for bisection jobs as well. Update #501
Diffstat (limited to 'dashboard/app/reporting.go')
-rw-r--r--dashboard/app/reporting.go12
1 files changed, 2 insertions, 10 deletions
diff --git a/dashboard/app/reporting.go b/dashboard/app/reporting.go
index a75372413..461605721 100644
--- a/dashboard/app/reporting.go
+++ b/dashboard/app/reporting.go
@@ -619,16 +619,8 @@ func incomingCommandTx(c context.Context, now time.Time, cmd *dashapi.BugUpdate,
}
if cmd.CrashID != 0 {
// Rememeber that we've reported this crash.
- crash := new(Crash)
- crashKey := datastore.NewKey(c, "Crash", "", cmd.CrashID, bugKey)
- if err := datastore.Get(c, crashKey, crash); err != nil {
- return false, internalError, fmt.Errorf("failed to get reported crash %v: %v",
- cmd.CrashID, err)
- }
- crash.Reported = now
- if _, err := datastore.Put(c, crashKey, crash); err != nil {
- return false, internalError, fmt.Errorf("failed to put reported crash %v: %v",
- cmd.CrashID, err)
+ if err := markCrashReported(c, cmd.CrashID, bugKey, now); err != nil {
+ return false, internalError, err
}
bugReporting.CrashID = cmd.CrashID
}