summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2019-04-25 15:59:53 +0000
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-04-25 15:59:53 +0000
commite83084fb34b4a875f148bb4d4d171c53f8b6fb7e (patch)
tree7f66802ea5e1dc6ad07d18a99dffff3d15af353e /config
parent9c39e328b10a7c89ff228d189b905e8f02b96f2b (diff)
downloadgitlab-ce-e83084fb34b4a875f148bb4d4d171c53f8b6fb7e.tar.gz
Enable Reliable fetcher by default
Diffstat (limited to 'config')
-rw-r--r--config/initializers/sidekiq.rb17
1 files changed, 14 insertions, 3 deletions
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb
index 2e4aa9c1053..19ff36d217f 100644
--- a/config/initializers/sidekiq.rb
+++ b/config/initializers/sidekiq.rb
@@ -45,9 +45,8 @@ Sidekiq.configure_server do |config|
ActiveRecord::Base.clear_all_connections!
end
- if Feature::FlipperFeature.table_exists? && Feature.enabled?(:gitlab_sidekiq_reliable_fetcher)
- # By default we're going to use Semi Reliable Fetch
- config.options[:semi_reliable_fetch] = Feature.enabled?(:gitlab_sidekiq_enable_semi_reliable_fetcher, default_enabled: true)
+ if enable_reliable_fetch?
+ config.options[:semi_reliable_fetch] = enable_semi_reliable_fetch_mode?
Sidekiq::ReliableFetch.setup_reliable_fetch!(config)
end
@@ -90,3 +89,15 @@ Sidekiq.configure_client do |config|
chain.add Gitlab::SidekiqStatus::ClientMiddleware
end
end
+
+def enable_reliable_fetch?
+ return true unless Feature::FlipperFeature.table_exists?
+
+ Feature.enabled?(:gitlab_sidekiq_reliable_fetcher, default_enabled: true)
+end
+
+def enable_semi_reliable_fetch_mode?
+ return true unless Feature::FlipperFeature.table_exists?
+
+ Feature.enabled?(:gitlab_sidekiq_enable_semi_reliable_fetcher, default_enabled: true)
+end