mirror of
https://github.com/lukaszraczylo/graphql-monitoring-proxy.git
synced 2026-10-22 06:38:13 +00:00
fix(config): support float64 env values in getDetailsFromEnv
The generic typed env reader only handled string/int/bool; any float64 key fell through to default, so CIRCUIT_FAILURE_RATIO, CIRCUIT_BACKOFF_ MULTIPLIER and RETRY_BUDGET_TOKENS_PER_SEC were silently impossible to override via environment (always the compile-time default). Add a float64 case mirroring the int one: parse the GMP_ prefixed key, then the plain key, else the default (envutil has no GetFloat). Test: extended Test_getDetailsFromEnv with float-valid and float-malformed cases.
This commit is contained in:
@@ -154,6 +154,8 @@ func (suite *Tests) Test_getDetailsFromEnv() {
|
||||
{"default", "envValue", "string value", "TEST_STRING", "envValue"},
|
||||
{0, 123, "int value", "TEST_INT", "123"},
|
||||
{false, true, "bool value", "TEST_BOOL", "true"},
|
||||
{0.5, 0.25, "float value", "TEST_FLOAT", "0.25"},
|
||||
{0.5, 0.5, "float default on malformed value", "TEST_FLOAT_BAD", "not-a-number"},
|
||||
{"default", "default", "default value", "NON_EXISTENT", ""},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user