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

Fix option initialization for queues #195

Merged
merged 3 commits into from
Apr 18, 2016
Merged

Fix option initialization for queues #195

merged 3 commits into from
Apr 18, 2016

Conversation

laCour
Copy link
Contributor

@laCour laCour commented Apr 17, 2016

This corrects option initialization when invoking shoryuken via the command line, and also fixes setting configuration options using the Rails environment with gems like dotenv.

Since PR #191, queues from the configuration file were being overwritten by the command line's default options—effectively being ignored.

This is necessary for invoking shoryuken directly, while maintaining support for loading via `EnvironmentLoader#load`. This is useful when configuration options are set via the environment through a gem (e.g. dotenv).
@@ -92,6 +92,7 @@ def load_rails
require File.expand_path('config/environment.rb')
end

Shoryuken.options.merge!(config_file_options)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@laCour is it a possible fix for what @waynerobinson commented out here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@phstc I've updated the PR to fix this issue as well. The options passed from the CLI were destructively overwriting the options from the configuration file on merge, because an empty array was being passed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@laCour laCour changed the title Reload configuration after loading rails Fix option initialization for queues and Rails environments Apr 18, 2016
@laCour laCour changed the title Fix option initialization for queues and Rails environments Fix option initialization for queues Apr 18, 2016
@phstc phstc merged commit cffe063 into ruby-shoryuken:master Apr 18, 2016
@phstc
Copy link
Collaborator

phstc commented Apr 18, 2016

@laCour Thanks a lot! Added to master 🍻

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

Successfully merging this pull request may close these issues.

2 participants