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

Prevent unnecessary doubled loading of environment variables #291

Merged
merged 2 commits into from
Nov 30, 2020

Conversation

cjlarose
Copy link
Member

Calling Config.load_files ends up reading environment variables and setting them in the Options object twice.

Config.load_files calls Options#load! (an alias for Options#reload!), which calls Options#reload_env!.

Then Config.load_files immediately calls Options#load_env!, which is just an alias for Options#reload_env!.

Since Options#reload_env! is idempotent, I can't imagine this being necessary or desirable. This redundancy has present since support for overriding settings with environment variables was introduced in #64.

@cjlarose cjlarose force-pushed the remove-redundant-load-env branch from fe896db to b1e6b5a Compare November 26, 2020 23:15
@pkuczynski pkuczynski changed the title Remove redundant call to Options#load_env Prevent unnecessary doubled loading of environment variables Nov 30, 2020
Copy link
Member

@pkuczynski pkuczynski left a comment

Choose a reason for hiding this comment

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

Thanks!

@pkuczynski pkuczynski merged commit 4e3a9ea into rubyconfig:master Nov 30, 2020
ippachi pushed a commit to ippachi/config-1 that referenced this pull request Oct 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants