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

Unified Diff: filter/txnBuf/state.go

Issue 1929423002: filter/txnBuf: Use fully-qualified App ID. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/gae@master
Patch Set: Use public methods for defining Info service in tests. Created 4 years, 8 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/context.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: filter/txnBuf/state.go
diff --git a/filter/txnBuf/state.go b/filter/txnBuf/state.go
index f32f2924279c4a013b4feb2272c15eeabd01fa67..4e22c3d12a584b3aa9b5e1531827852f9210d42b 100644
--- a/filter/txnBuf/state.go
+++ b/filter/txnBuf/state.go
@@ -145,23 +145,18 @@ func withTxnBuf(ctx context.Context, cb func(context.Context) error, opts *datas
writeCountBudget = parentState.writeCountBudget - parentState.entState.numWrites()
}
- bufDS, err := memory.NewDatastore(inf.FullyQualifiedAppID(), ns)
- if err != nil {
- return err
- }
-
state := &txnBufState{
entState: &sizeTracker{},
- bufDS: bufDS.Raw(),
+ bufDS: memory.NewDatastore(inf).Raw(),
roots: roots,
rootLimit: rootLimit,
ns: ns,
- aid: inf.AppID(),
+ aid: inf.FullyQualifiedAppID(),
parentDS: datastore.Get(context.WithValue(ctx, dsTxnBufHaveLock, true)).Raw(),
sizeBudget: sizeBudget,
writeCountBudget: writeCountBudget,
}
- if err = cb(context.WithValue(ctx, dsTxnBufParent, state)); err != nil {
+ if err := cb(context.WithValue(ctx, dsTxnBufParent, state)); err != nil {
return err
}
@@ -172,7 +167,7 @@ func withTxnBuf(ctx context.Context, cb func(context.Context) error, opts *datas
return commitToReal(state)
}
- if err = parentState.canApplyLocked(state); err != nil {
+ if err := parentState.canApplyLocked(state); err != nil {
return err
}
« no previous file with comments | « no previous file | impl/memory/context.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698