Skip to content

Commit

Permalink
Suppress config access warnings
Browse files Browse the repository at this point in the history
like
WARN: `config.options[:key] = value` is deprecated, use `config[:key] = value`
  • Loading branch information
adamruzicka committed Oct 19, 2023
1 parent 453523f commit 29765b7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/dynflow/executors/sidekiq/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
Sidekiq.configure_server do |config|
# Use semi-reliable fetch
# for details see https://gitlab.com/gitlab-org/sidekiq-reliable-fetch/blob/master/README.md
config.options[:semi_reliable_fetch] = true
config[:semi_reliable_fetch] = true
Sidekiq::ReliableFetch.setup_reliable_fetch!(config)
end

Expand Down
8 changes: 4 additions & 4 deletions lib/dynflow/rails/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ def increase_db_pool_size?
end

def sidekiq_worker?
defined?(::Sidekiq) && ::Sidekiq.options[:queues].any?
defined?(::Sidekiq) && ::Sidekiq.configure_server { |c| c[:queues].any? }
end

def calculate_db_pool_size(world)
return self.db_pool_size if self.db_pool_size

base_value = 5
if defined?(::Sidekiq)
Sidekiq.options[:concurrency] + base_value
Sidekiq.configure_server { |c| c[:concurrency] } + base_value
else
world.config.queues.values.inject(base_value) do |pool_size, pool_options|
pool_size += pool_options[:pool_size]
Expand Down Expand Up @@ -152,7 +152,7 @@ def world_config
# we can't do any operation until the Rails.application.dynflow.world is set
config.auto_execute = false
config.auto_validity_check = false
if sidekiq_worker? && !Sidekiq.options[:queues].include?("dynflow_orchestrator")
if sidekiq_worker? && !Sidekiq.configure_server { |c| c[:queues].include?("dynflow_orchestrator") }
config.delayed_executor = nil
end
end
Expand Down Expand Up @@ -192,7 +192,7 @@ def initialize_executor(world)
if remote?
false
else
if defined?(::Sidekiq) && Sidekiq.options[:dynflow_executor]
if defined?(::Sidekiq) && Sidekiq.configure_server { |c| c[:dynflow_executor] }
::Dynflow::Executors::Sidekiq::Core
else
::Dynflow::Executors::Parallel::Core
Expand Down

0 comments on commit 29765b7

Please sign in to comment.