diff options
Diffstat (limited to 'lib/gitlab/redis/multi_store.rb')
-rw-r--r-- | lib/gitlab/redis/multi_store.rb | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/lib/gitlab/redis/multi_store.rb b/lib/gitlab/redis/multi_store.rb index c0fab462786..46ffa8cbc1b 100644 --- a/lib/gitlab/redis/multi_store.rb +++ b/lib/gitlab/redis/multi_store.rb @@ -169,11 +169,15 @@ module Gitlab end def use_primary_and_secondary_stores? - feature_enabled?("use_primary_and_secondary_stores_for") + Feature.feature_flags_available? && + Feature.enabled?("use_primary_and_secondary_stores_for_#{instance_name.underscore}") && # rubocop:disable Cop/FeatureFlagUsage + !same_redis_store? end def use_primary_store_as_default? - feature_enabled?("use_primary_store_as_default_for") + Feature.feature_flags_available? && + Feature.enabled?("use_primary_store_as_default_for_#{instance_name.underscore}") && # rubocop:disable Cop/FeatureFlagUsage + !same_redis_store? end def increment_pipelined_command_error_count(command_name) @@ -213,20 +217,6 @@ module Gitlab private - # @return [Boolean] - def feature_enabled?(prefix) - feature_table_exists? && - Feature.enabled?("#{prefix}_#{instance_name.underscore}") && # rubocop:disable Cop/FeatureFlagUsage - !same_redis_store? - end - - # @return [Boolean] - def feature_table_exists? - Feature::FlipperFeature.table_exists? - rescue StandardError - false - end - def default_store use_primary_store_as_default? ? primary_store : secondary_store end |