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

Unified Diff: filter/dscache/globalconfig.go

Issue 1916463004: impl/memory: Disallow empty namespace. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/gae@master
Patch Set: 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/datastore.go » ('j') | impl/memory/datastore_query_execution_test.go » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: filter/dscache/globalconfig.go
diff --git a/filter/dscache/globalconfig.go b/filter/dscache/globalconfig.go
index d3fa620a09d9a8cbc68765f145ab1da6032db024..f116805fb0dbdbb35201854c25b23a441a91953f 100644
--- a/filter/dscache/globalconfig.go
+++ b/filter/dscache/globalconfig.go
@@ -9,7 +9,6 @@ import (
"time"
"github.com/luci/gae/service/datastore"
- "github.com/luci/gae/service/info"
"github.com/luci/gae/service/memcache"
"github.com/luci/luci-go/common/clock"
"golang.org/x/net/context"
@@ -74,10 +73,6 @@ func IsGloballyEnabled(c context.Context) bool {
}
// always go to the default namespace
- c, err := info.Get(c).Namespace("")
- if err != nil {
- return true
- }
cfg := &GlobalConfig{Enable: true}
if err := datastore.Get(c).Get(cfg); err != nil && err != datastore.ErrNoSuchEntity {
return true
@@ -92,11 +87,6 @@ func IsGloballyEnabled(c context.Context) bool {
// It's meant to be called from admin handlers on your app to turn dscache
// functionality on or off in emergencies.
func SetGlobalEnable(c context.Context, memcacheEnabled bool) error {
- // always go to the default namespace
- c, err := info.Get(c).Namespace("")
- if err != nil {
- return err
- }
return datastore.Get(c).RunInTransaction(func(c context.Context) error {
ds := datastore.Get(c)
cfg := &GlobalConfig{Enable: true}
« no previous file with comments | « no previous file | impl/memory/datastore.go » ('j') | impl/memory/datastore_query_execution_test.go » ('J')

Powered by Google App Engine
This is Rietveld 408576698