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

Unified Diff: filter/dscache/context.go

Issue 1579853002: Add dscache.AlwaysFilterRDS function. (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: Created 4 years, 11 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: filter/dscache/context.go
diff --git a/filter/dscache/context.go b/filter/dscache/context.go
index a9f10ba1de6fbf0955edf5800ce4f3842925c0e6..3cd81dec505dc90ebfb0e0c753b9492c53d7b56d 100644
--- a/filter/dscache/context.go
+++ b/filter/dscache/context.go
@@ -32,7 +32,14 @@ func FilterRDS(c context.Context, shardsForKey func(*ds.Key) int) context.Contex
if !IsGloballyEnabled(c) {
return c
}
+ return AlwaysFilterRDS(c, shardsForKey)
+}
+// AlwaysFilterRDS installs a caching RawDatastore filter in the context.
+//
+// Unlike FilterRDS it doesn't check GlobalConfig via IsGloballyEnabled call,
+// assuming caller already knows whether filter should be applied or not.
+func AlwaysFilterRDS(c context.Context, shardsForKey func(*ds.Key) int) context.Context {
return ds.AddRawFilters(c, func(c context.Context, ds ds.RawInterface) ds.RawInterface {
i := info.Get(c)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698