Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure sidekiq workers increase their db pool size #362

Merged
merged 2 commits into from
Aug 28, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/dynflow/rails.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ def initialize!
init_world.tap do |world|
@world = world
config.run_on_init_hooks(false, world)
config.increase_db_pool_size(world) if config.increase_db_pool_size?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is checked inside of the method already.

Suggested change
config.increase_db_pool_size(world) if config.increase_db_pool_size?
config.increase_db_pool_size(world)

unless config.remote?
config.increase_db_pool_size(world)
config.run_on_init_hooks(true, world)
# leave this just for long-running executors
unless config.rake_task_with_executor?
Expand Down
6 changes: 5 additions & 1 deletion lib/dynflow/rails/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,11 @@ def rake_task_with_executor?
end

def increase_db_pool_size?
!::Rails.env.test? && !remote?
!::Rails.env.test? && (!remote? || sidekiq_worker?)
end

def sidekiq_worker?
defined?(::Sidekiq) && ::Sidekiq.options[:queues].any?
end

def calculate_db_pool_size(world)
Expand Down