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

Unified Diff: impl/memory/context.go

Issue 1372473002: Add the ability to disable special automatic entities in impl/memory (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: add more docstring Created 5 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
« no previous file with comments | « no previous file | impl/memory/datastore.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/memory/context.go
diff --git a/impl/memory/context.go b/impl/memory/context.go
index 9b388e70fc761a01eca96c7f23a9375344f1d0b6..286736b4ade8e23c3c2e0c90ef5a508f20715d01 100644
--- a/impl/memory/context.go
+++ b/impl/memory/context.go
@@ -135,6 +135,10 @@ var memContextKey memContextKeyType
// test-access API for TaskQueue better (instead of trying to reconstitute the
// state of the task queue from a bunch of datastore accesses).
func (d *dsImpl) RunInTransaction(f func(context.Context) error, o *ds.TransactionOptions) error {
+ if d.data.getDisableSpecialEntities() {
+ return errors.New("special entities are disabled. no transactions for you")
+ }
+
// Keep in separate function for defers.
loopBody := func(applyForReal bool) error {
curMC := cur(d.c)
« no previous file with comments | « no previous file | impl/memory/datastore.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698