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 <svc.cloudjenkins@instructure.com>
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Cody Cutrer 2020-10-08 14:48:01 -06:00
parent 33b328e305
commit 224377a50c
1 changed files with 1 additions and 1 deletions

View File

@ -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?