File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
lib/datadog/core/configuration Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -121,15 +121,9 @@ def unset(precedence)
121121
122122 def get
123123 unless @is_set
124- # Previously, `set_value_from_env_or_default` was only setting env or default value, not both.
125- # Which is problematic if we want to `unset` an env value, as it would not fallback on the default value.
126- #
127- # It also had inconsistent behavior. If an option didn't have an env,
128- # it would call `set` with DEFAULT precedence and value, and set `@is_set` to true.
129- # But if an option did have an env, it would set it with ENVIRONMENT precedence,
130- # then by calling `unset` on the ENVIRONMENT value, it would `reset` the option,
131- # set DEFAULT precedence and value, and change `@is_set` to false. because @is_set is false,
132- # calling `get` would again call `set_value_from_env_or_default` and set the option back to the env value.
124+ # Ensures that both the default value and the environment value are set.
125+ # This approach handles scenarios where an environment value is unset
126+ # by falling back to the default value consistently.
133127 set_default_value
134128 set_env_value
135129 end
You can’t perform that action at this time.
0 commit comments