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

Unified Diff: impl/prod/taskqueue.go

Issue 1494223002: Add API to allow you to get the non-transactional datastore or taskqueue. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: Created 5 years 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: impl/prod/taskqueue.go
diff --git a/impl/prod/taskqueue.go b/impl/prod/taskqueue.go
index 08c3441ccfca6b4e6f8b0c46fabd75fc166e7b40..b224b05268c6d4977868fba4cec6994515f31de9 100644
--- a/impl/prod/taskqueue.go
+++ b/impl/prod/taskqueue.go
@@ -17,8 +17,11 @@ import (
// useTQ adds a gae.TaskQueue implementation to context, accessible
// by gae.GetTQ(c)
func useTQ(c context.Context) context.Context {
- return tq.SetRawFactory(c, func(ci context.Context) tq.RawInterface {
- return tqImpl{AEContext(ci)}
+ return tq.SetRawFactory(c, func(ci context.Context, wantTxn bool) tq.RawInterface {
+ if wantTxn {
+ return tqImpl{AEContext(ci)}
+ }
+ return tqImpl{AEContextNoTX(ci)}
Vadim Sh. 2015/12/04 03:22:04 why this is so much simpler than the others (or, w
})
}

Powered by Google App Engine
This is Rietveld 408576698