diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-20 21:06:38 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-11-20 21:06:38 +0000 |
commit | 2477ab5553eabc6c4579cb23aba620ffc8cba228 (patch) | |
tree | 72d34d8135c6318130e9697b900507dace9cb035 /config | |
parent | fdffdcf1abaa2cab903f1d32610eb562cdf53906 (diff) | |
download | gitlab-ce-2477ab5553eabc6c4579cb23aba620ffc8cba228.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/sidekiq.rb | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/config/initializers/sidekiq.rb b/config/initializers/sidekiq.rb index b5d98399015..c3ca9bf3e05 100644 --- a/config/initializers/sidekiq.rb +++ b/config/initializers/sidekiq.rb @@ -31,21 +31,17 @@ enable_json_logs = Gitlab.config.sidekiq.log_format == 'json' enable_sidekiq_memory_killer = ENV['SIDEKIQ_MEMORY_KILLER_MAX_RSS'].to_i.nonzero? use_sidekiq_daemon_memory_killer = ENV["SIDEKIQ_DAEMON_MEMORY_KILLER"].to_i.nonzero? use_sidekiq_legacy_memory_killer = !use_sidekiq_daemon_memory_killer +use_request_store = ENV['SIDEKIQ_REQUEST_STORE'].to_i.nonzero? Sidekiq.configure_server do |config| config.redis = queues_config_hash - config.server_middleware do |chain| - chain.add Gitlab::SidekiqMiddleware::Monitor - chain.add Gitlab::SidekiqMiddleware::Metrics if Settings.monitoring.sidekiq_exporter - chain.add Gitlab::SidekiqMiddleware::ArgumentsLogger if ENV['SIDEKIQ_LOG_ARGUMENTS'] && !enable_json_logs - chain.add Gitlab::SidekiqMiddleware::MemoryKiller if enable_sidekiq_memory_killer && use_sidekiq_legacy_memory_killer - chain.add Gitlab::SidekiqMiddleware::RequestStoreMiddleware unless ENV['SIDEKIQ_REQUEST_STORE'] == '0' - chain.add Gitlab::SidekiqMiddleware::BatchLoader - chain.add Gitlab::SidekiqMiddleware::CorrelationLogger - chain.add Gitlab::SidekiqMiddleware::InstrumentationLogger - chain.add Gitlab::SidekiqStatus::ServerMiddleware - end + config.server_middleware(&Gitlab::SidekiqMiddleware.server_configurator({ + metrics: Settings.monitoring.sidekiq_exporter, + arguments_logger: ENV['SIDEKIQ_LOG_ARGUMENTS'] && !enable_json_logs, + memory_killer: enable_sidekiq_memory_killer && use_sidekiq_legacy_memory_killer, + request_store: use_request_store + })) if enable_json_logs Sidekiq.logger.formatter = Gitlab::SidekiqLogging::JSONFormatter.new @@ -56,10 +52,7 @@ Sidekiq.configure_server do |config| config.error_handlers << Gitlab::SidekiqLogging::ExceptionHandler.new end - config.client_middleware do |chain| - chain.add Gitlab::SidekiqStatus::ClientMiddleware - chain.add Gitlab::SidekiqMiddleware::CorrelationInjector - end + config.client_middleware(&Gitlab::SidekiqMiddleware.client_configurator) config.on :startup do # Clear any connections that might have been obtained before starting |