don't bother caching a constant for feature flags

refs CNVS-30659

Change-Id: If90aedf26994f0012fa1efebf875451779c2cc97
Reviewed-on: https://gerrit.instructure.com/86712
Tested-by: Jenkins
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Cody Cutrer 2016-08-02 12:55:46 -06:00
parent 0668a4ea52
commit 36fe264507
1 changed files with 4 additions and 6 deletions

View File

@ -77,14 +77,12 @@ module FeatureFlags
# each account that needs to be searched for a feature flag, in priority order,
# starting with site admin
def feature_flag_account_ids
return [Account.site_admin.global_id] if is_a?(User)
RequestCache.cache('feature_flag_account_ids', self) do
Rails.cache.fetch(['feature_flag_account_ids', self].cache_key) do
if is_a?(User)
chain = [Account.site_admin]
else
chain = account_chain(include_site_admin: true)
chain.shift if is_a?(Account)
end
chain = account_chain(include_site_admin: true)
chain.shift if is_a?(Account)
chain.reverse.map(&:global_id)
end
end