diff options
author | John Cai <jcai@gitlab.com> | 2020-06-17 21:09:22 +0300 |
---|---|---|
committer | John Cai <jcai@gitlab.com> | 2020-06-30 19:33:01 +0300 |
commit | 51fd5e865fe5b72f192c3cccedeb05acbf6833ee (patch) | |
tree | 896d729980897e3f2be91db80cc676f1ffd89665 /internal/cache | |
parent | 47e3d121f6bb5d719b7f46fa4fc65df4cf8c6b91 (diff) |
Turn feature flags into struct with default value
Uses a struct for feature flags so there can be consistent behavior
around enabled by default.
Diffstat (limited to 'internal/cache')
-rw-r--r-- | internal/cache/cachedb_test.go | 2 | ||||
-rw-r--r-- | internal/cache/keyer.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/internal/cache/cachedb_test.go b/internal/cache/cachedb_test.go index 3f0b40fd0..9743a0c0c 100644 --- a/internal/cache/cachedb_test.go +++ b/internal/cache/cachedb_test.go @@ -94,7 +94,7 @@ func TestStreamDBNaiveKeyer(t *testing.T) { // enabled feature flags affect caching oldCtx := ctx - ctx = featureflag.IncomingCtxWithFeatureFlag(ctx, "meow") + ctx = featureflag.IncomingCtxWithFeatureFlag(ctx, featureflag.FeatureFlag{"meow", false}) expectGetMiss(req1) ctx = oldCtx expectGetHit(expectStream2, req1) diff --git a/internal/cache/keyer.go b/internal/cache/keyer.go index 78af7d170..8df5e1e98 100644 --- a/internal/cache/keyer.go +++ b/internal/cache/keyer.go @@ -315,7 +315,7 @@ func compositeKeyHashHex(ctx context.Context, genID string, req proto.Message) ( h := sha256.New() - ffs := featureflag.AllEnabledFlags(ctx) + ffs := featureflag.AllFlags(ctx) sort.Strings(ffs) for _, i := range []string{ |