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

Unified Diff: dm/appengine/distributor/notify_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/distributor/notify_execution.go
diff --git a/dm/appengine/distributor/notify_execution.go b/dm/appengine/distributor/notify_execution.go
index 2b0f471ae34cc9004ae029bcddae4f1f28806cb5..c8b3a55745f9397ae94a5124bba3829c5e68969b 100644
--- a/dm/appengine/distributor/notify_execution.go
+++ b/dm/appengine/distributor/notify_execution.go
@@ -5,7 +5,9 @@
package distributor
import (
+ "github.com/luci/gae/filter/txnBuf"
"github.com/luci/gae/service/datastore"
+ "github.com/luci/luci-go/common/errors"
"github.com/luci/luci-go/common/logging"
"github.com/luci/luci-go/dm/appengine/model"
"github.com/luci/luci-go/tumble"
@@ -36,7 +38,12 @@ func (f *NotifyExecution) RollForward(c context.Context) (muts []tumble.Mutation
}.Errorf(c, "Failed to make distributor")
return
}
- rslt, err := dist.HandleNotification(f.Notification)
+ dsNoTx := txnBuf.GetNoTxn(c)
+ q := &model.Quest{ID: f.Notification.ID.Quest}
+ if err := dsNoTx.Get(q); err != nil {
+ return nil, errors.Annotate(err).Reason("getting Quest").Err()
+ }
+ rslt, err := dist.HandleNotification(&q.Desc, f.Notification)
if err != nil {
// TODO(riannucci): check for transient/non-transient
logging.Fields{

Powered by Google App Engine
This is Rietveld 408576698