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

Unified Diff: go/src/infra/gae/libs/meta/eg.go

Issue 1227183003: Change RawDatastore to do less reflection. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@move_dummy
Patch Set: fix No/ShouldIndex Created 5 years, 5 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 | « go/src/infra/gae/libs/gae/upstream_errors.go ('k') | go/src/infra/gae/libs/meta/eg_test.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/src/infra/gae/libs/meta/eg.go
diff --git a/go/src/infra/gae/libs/meta/eg.go b/go/src/infra/gae/libs/meta/eg.go
index 8522d5051d6dc7f5e98c26c8d945cb605a1780f0..9997679e5de1c805046f8b65626c32f04c3a3421 100644
--- a/go/src/infra/gae/libs/meta/eg.go
+++ b/go/src/infra/gae/libs/meta/eg.go
@@ -10,6 +10,7 @@ import (
"github.com/luci/luci-go/common/errors"
"infra/gae/libs/gae"
+ "infra/gae/libs/gae/helper"
)
var mark = errors.MakeMarkFn("eg")
@@ -28,15 +29,14 @@ func GetEntityGroupVersion(c context.Context, root gae.DSKey) (int64, error) {
for root.Parent() != nil {
root = root.Parent()
}
- egm := &EntityGroupMeta{}
rds := gae.GetRDS(c)
- err := rds.Get(rds.NewKey("__entity_group__", "", 1, root), egm)
- if err != gae.ErrDSNoSuchEntity {
- err = mark(err)
- } else {
+ egm := &EntityGroupMeta{}
+ err := rds.Get(rds.NewKey("__entity_group__", "", 1, root), helper.GetPLS(egm))
+ ret := egm.Version
+ if err == gae.ErrDSNoSuchEntity {
// this is OK for callers. The version of the entity group is effectively 0
// in this case.
err = nil
}
- return egm.Version, err
+ return ret, err
}
« no previous file with comments | « go/src/infra/gae/libs/gae/upstream_errors.go ('k') | go/src/infra/gae/libs/meta/eg_test.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698