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

Update database.yml pool size in sidekiq recipe #391

Open
plantoeat opened this issue Feb 26, 2019 · 0 comments
Open

Update database.yml pool size in sidekiq recipe #391

plantoeat opened this issue Feb 26, 2019 · 0 comments

Comments

@plantoeat
Copy link

plantoeat commented Feb 26, 2019

I have a custom recipe that is updating my database.yml file after the sidekiq recipe runs so my database.yml file has pool: #{node['sidekiq']['concurrency']+2}. Before this change I would get frequent ActiveRecord::ConnectionTimeoutError errors.

Im my case, my custom recipe is using sed to find a replace pool: 5 with pool: 7.
command "sed -ibak --follow-symlinks 's/pool: #{node['sidekiq']['concurrency']}/pool: #{(node['sidekiq']['concurrency']+2)}/g' #{db_yaml_file}"

Can this change be made in the main sidekiq recipe so I don't have to have a custom recipe?

Two lines need to be updated:

command "sed -ibak --follow-symlinks 's/reconnect/pool: #{node['sidekiq']['concurrency']}\\\n reconnect/g' #{db_yaml_file}"

only_if "test -f #{db_yaml_file} && ! grep 'pool: *#{node['sidekiq']['concurrency']}' #{db_yaml_file}"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant