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

Unified Diff: impl/prod/datastore_key.go

Issue 1490243004: Make appengine connection explicitly owned by impl/prod. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: fix other services too 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
« no previous file with comments | « impl/prod/context.go ('k') | impl/prod/everything_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/prod/datastore_key.go
diff --git a/impl/prod/datastore_key.go b/impl/prod/datastore_key.go
index d5853353f41ed92cc74032d58f1d8746b0170a2e..a471310bbafc33b0a4f62d1fc488a2784e5f7b5b 100644
--- a/impl/prod/datastore_key.go
+++ b/impl/prod/datastore_key.go
@@ -41,7 +41,7 @@ func dsR2F(k *datastore.Key) *ds.Key {
}
// dsF2R (DS fake-to-real) converts a DSKey back to an SDK *Key.
-func dsF2R(ctx context.Context, k *ds.Key) (*datastore.Key, error) {
+func dsF2R(aeCtx context.Context, k *ds.Key) (*datastore.Key, error) {
Vadim Sh. 2015/12/03 00:49:57 how do you feel about adding a typedef for AE cont
if k == nil {
return nil, nil
}
@@ -49,26 +49,26 @@ func dsF2R(ctx context.Context, k *ds.Key) (*datastore.Key, error) {
// drop aid.
_, ns, toks := k.Split()
err := error(nil)
- ctx, err = appengine.Namespace(ctx, ns)
+ aeCtx, err = appengine.Namespace(aeCtx, ns)
if err != nil {
return nil, err
}
- ret := datastore.NewKey(ctx, toks[0].Kind, toks[0].StringID, toks[0].IntID, nil)
+ ret := datastore.NewKey(aeCtx, toks[0].Kind, toks[0].StringID, toks[0].IntID, nil)
for _, t := range toks[1:] {
- ret = datastore.NewKey(ctx, t.Kind, t.StringID, t.IntID, ret)
+ ret = datastore.NewKey(aeCtx, t.Kind, t.StringID, t.IntID, ret)
}
return ret, nil
}
// dsMF2R (DS multi-fake-to-fake) converts a slice of wrapped keys to SDK keys.
-func dsMF2R(ctx context.Context, ks []*ds.Key) ([]*datastore.Key, error) {
+func dsMF2R(aeCtx context.Context, ks []*ds.Key) ([]*datastore.Key, error) {
lme := errors.NewLazyMultiError(len(ks))
ret := make([]*datastore.Key, len(ks))
err := error(nil)
for i, k := range ks {
- ret[i], err = dsF2R(ctx, k)
+ ret[i], err = dsF2R(aeCtx, k)
lme.Assign(i, err)
}
return ret, lme.Get()
« no previous file with comments | « impl/prod/context.go ('k') | impl/prod/everything_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698