From 8b4af88cc4a760ca8b6270b5d16389b0d56ac73e Mon Sep 17 00:00:00 2001 From: Keenan Brock Date: Fri, 18 Sep 2020 17:04:34 -0400 Subject: [PATCH] extract options from TokenStore.aquire --- lib/token_store.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/token_store.rb b/lib/token_store.rb index 9b3f9cb05bc..9927116880b 100644 --- a/lib/token_store.rb +++ b/lib/token_store.rb @@ -1,17 +1,20 @@ class TokenStore @token_caches = {} # Hash of Memory/Dalli Store Caches, Keyed by namespace + # only used by TokenManager.token_store + # @return a token store for users def self.acquire(namespace, token_ttl) @token_caches[namespace] ||= begin + options = cache_store_options(namespace, token_ttl) case ::Settings.server.session_store when "sql" - SqlStore.new(cache_store_options(namespace, token_ttl)) + SqlStore.new(options) when "memory" require 'active_support/cache/memory_store' - ActiveSupport::Cache::MemoryStore.new(cache_store_options(namespace, token_ttl)) + ActiveSupport::Cache::MemoryStore.new(options) when "cache" require 'active_support/cache/dalli_store' - ActiveSupport::Cache::DalliStore.new(MiqMemcached.server_address, cache_store_options(namespace, token_ttl)) + ActiveSupport::Cache::DalliStore.new(MiqMemcached.server_address, options) else raise "unsupported session store type: #{::Settings.server.session_store}" end