From 224377a50ccb0127e739f686a96b3238640f094c Mon Sep 17 00:00:00 2001 From: Cody Cutrer Date: Thu, 8 Oct 2020 14:48:01 -0600 Subject: [PATCH] only skip feature flag cache for the immediate model i.e. the page you're on. this prevents constantly querying site admin feature flags directly when getting user feature flags, while still preserving what looks like cache coherency when you flip an account level feature flag Change-Id: I694c83da3d548ae34428d3ffd8e18e2384df6656 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/249645 Tested-by: Service Cloud Jenkins Reviewed-by: James Williams QA-Review: Cody Cutrer Product-Review: Cody Cutrer --- lib/feature_flags.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/feature_flags.rb b/lib/feature_flags.rb index 7c246d8ba00..2854b805eba 100644 --- a/lib/feature_flags.rb +++ b/lib/feature_flags.rb @@ -138,7 +138,7 @@ module FeatureFlags account end (accounts + [self]).each do |context| - flag = context.feature_flag(feature, skip_cache: skip_cache) + flag = context.feature_flag(feature, skip_cache: context == self && skip_cache) next unless flag retval = flag break unless flag.allowed?