-
Notifications
You must be signed in to change notification settings - Fork 598
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
auto convert :auto to :prepend/:chain in config #1930
Changes from 5 commits
7b226f5
abd5c89
7735f92
0d6eb27
24f8163
5084f2f
bf3b5ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -179,6 +179,15 @@ def fetch_config_value(key) | |
return valid_value | ||
end | ||
|
||
# update any :auto config value to be either :prepend or :chain after auto | ||
# determination has selected one of those to use | ||
def update_config_value(use_prepend) | ||
if config_key && auto_configured? | ||
NewRelic::Agent.config.instance_variable_get(:@cache)[config_key] = use_prepend ? :prepend : :chain | ||
end | ||
use_prepend | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this saying we are always returning There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Precisely. We hook into this existing method that returns a boolean, so here we make sure we still always return a boolean. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it I see what is happening now. Thank you :) |
||
end | ||
|
||
def config_value | ||
return AUTO_CONFIG_VALUE unless config_key | ||
|
||
|
@@ -202,7 +211,7 @@ def conflicts_with_prepend(&block) | |
end | ||
|
||
def use_prepend? | ||
prepend_configured? || (auto_configured? && !prepend_conflicts?) | ||
update_config_value(prepend_configured? || (auto_configured? && !prepend_conflicts?)) | ||
end | ||
|
||
def prepend_conflicts? | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you be up for changing "method prepending or chaining" to "module prepending or method chaining" in the title and the body copy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Certainly! Addressed with bf3b5ee