Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2692)

Unified Diff: appengine/cmd/dm/mutate/ensure_attempt.go

Issue 1537883002: Initial distributor implementation (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@master
Patch Set: fix imports and make dummy.go a real file Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « appengine/cmd/dm/mutate/add_finished_deps_test.go ('k') | appengine/cmd/dm/mutate/ensure_attempt_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/cmd/dm/mutate/ensure_attempt.go
diff --git a/appengine/cmd/dm/mutate/ensure_attempt.go b/appengine/cmd/dm/mutate/ensure_attempt.go
index 005c51e9c9f96575b3f360f8eca6af8ccaa62c34..25931c0d2792557af609837def087d9493a45365 100644
--- a/appengine/cmd/dm/mutate/ensure_attempt.go
+++ b/appengine/cmd/dm/mutate/ensure_attempt.go
@@ -21,7 +21,7 @@ type EnsureAttempt struct {
// Root implements tumble.Mutation.
func (e *EnsureAttempt) Root(c context.Context) *datastore.Key {
- return datastore.Get(c).KeyForObj(&model.Attempt{ID: *e.ID})
+ return model.AttemptKeyFromID(c, e.ID)
}
// RollForward implements tumble.Mutation.
@@ -29,14 +29,14 @@ func (e *EnsureAttempt) RollForward(c context.Context) (muts []tumble.Mutation,
ds := datastore.Get(c)
a := model.MakeAttempt(c, e.ID)
- err = ds.Get(a)
- if err != datastore.ErrNoSuchEntity {
+ if err = ds.Get(a); err != datastore.ErrNoSuchEntity {
return
}
if err = ds.Put(a); err != nil {
logging.WithError(err).Errorf(logging.SetField(c, "id", e.ID), "in put")
}
+ muts = append(muts, &ScheduleExecution{e.ID})
return
}
« no previous file with comments | « appengine/cmd/dm/mutate/add_finished_deps_test.go ('k') | appengine/cmd/dm/mutate/ensure_attempt_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698