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

Unified Diff: dm/appengine/mutate/timeout_execution.go

Issue 2347973003: Refactor distributor API so that methods always get the Quest_Desc too. (Closed)
Patch Set: Created 4 years, 3 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
Index: dm/appengine/mutate/timeout_execution.go
diff --git a/dm/appengine/mutate/timeout_execution.go b/dm/appengine/mutate/timeout_execution.go
index 058d05305241219b0cf29091299feafd5ac1fb6b..71bee45a2c63b59be42d68a1f78e6f8af062ebc2 100644
--- a/dm/appengine/mutate/timeout_execution.go
+++ b/dm/appengine/mutate/timeout_execution.go
@@ -10,8 +10,10 @@ import (
"golang.org/x/net/context"
+ "github.com/luci/gae/filter/txnBuf"
"github.com/luci/gae/service/datastore"
"github.com/luci/luci-go/common/clock"
+ "github.com/luci/luci-go/common/errors"
"github.com/luci/luci-go/common/logging"
dm "github.com/luci/luci-go/dm/api/service/v1"
"github.com/luci/luci-go/dm/appengine/distributor"
@@ -85,7 +87,12 @@ func (t *TimeoutExecution) RollForward(c context.Context) (muts []tumble.Mutatio
return
}
var realRslt *dm.Result
- realRslt, err = dist.GetStatus(distributor.Token(e.DistributorToken))
+ q := model.QuestFromID(t.For.Quest)
+ if err = txnBuf.GetNoTxn(c).Get(q); err != nil {
+ err = errors.Annotate(err).Reason("loading quest").Err()
+ return
+ }
+ realRslt, err = dist.GetStatus(&q.Desc, distributor.Token(e.DistributorToken))
if (err != nil || realRslt == nil) && t.TimeoutAttempt < maxTimeoutAttempts {
logging.Fields{
logging.ErrorKey: err,
« dm/appengine/distributor/fake/fake.go ('K') | « dm/appengine/mutate/schedule_execution.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698