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

Unified Diff: go/src/infra/gae/libs/gae/memory/globalinfo.go

Issue 1234343006: Some miscellaneous fixes: (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: 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/memory/context.go ('k') | go/src/infra/gae/libs/gae/memory/taskqueue_data.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: go/src/infra/gae/libs/gae/memory/globalinfo.go
diff --git a/go/src/infra/gae/libs/gae/memory/globalinfo.go b/go/src/infra/gae/libs/gae/memory/globalinfo.go
index 75232d406b250d1a5c4fec97898abb3bb3c92d7b..87f42f0a1717e41fb4c3cb97539727f32d0c4449 100644
--- a/go/src/infra/gae/libs/gae/memory/globalinfo.go
+++ b/go/src/infra/gae/libs/gae/memory/globalinfo.go
@@ -33,18 +33,29 @@ func useGI(c context.Context) context.Context {
// route this value through to without making the internal APIs really complex.
const globalAppID = "dev~app"
-type globalInfoData struct{ namespace string }
+type globalInfoData struct {
+ gae.BrokenFeatures
+
+ namespace string
+}
type giImpl struct {
gae.GlobalInfo
- data *globalInfoData
- c context.Context
+ *globalInfoData
+ c context.Context
}
var _ = gae.GlobalInfo((*giImpl)(nil))
-func (gi *giImpl) Namespace(ns string) (context.Context, error) {
- return context.WithValue(gi.c, giContextKey, &globalInfoData{ns}), nil
+func (gi *giImpl) Namespace(ns string) (ret context.Context, err error) {
+ err = gi.RunIfNotBroken(func() error {
+ ret = context.WithValue(gi.c, giContextKey, &globalInfoData{
+ curGID(gi.c).BrokenFeatures,
+ ns,
+ })
+ return nil
+ })
+ return
}
func (gi *giImpl) AppID() string {
« no previous file with comments | « go/src/infra/gae/libs/gae/memory/context.go ('k') | go/src/infra/gae/libs/gae/memory/taskqueue_data.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698